Reactjs 如何重置react应用程序的所有git命令并从新开始?
我在推github时遇到了麻烦,因为我是新手。我有多个专门用于同一个React应用程序的存储库,我一直在输入这些看似随机的git命令,因为我总是搞砸 我以前是在玩弄git的东西,但现在我有一个空的github回购协议,我想推动它。我如何重新设置我之前所做的一切,从第一步开始简单地将React应用程序推送到github 在cmd中,我编写了Github在您第一次创建repo时告诉您的所有基本步骤。这是输出:Reactjs 如何重置react应用程序的所有git命令并从新开始?,reactjs,git,github,Reactjs,Git,Github,我在推github时遇到了麻烦,因为我是新手。我有多个专门用于同一个React应用程序的存储库,我一直在输入这些看似随机的git命令,因为我总是搞砸 我以前是在玩弄git的东西,但现在我有一个空的github回购协议,我想推动它。我如何重新设置我之前所做的一切,从第一步开始简单地将React应用程序推送到github 在cmd中,我编写了Github在您第一次创建repo时告诉您的所有基本步骤。这是输出: C:\Users\zzzz\Documents\gap>git init Rein
C:\Users\zzzz\Documents\gap>git init
Reinitialized existing Git repository in C:/Users/zzzz/Documents/gap/.git/
C:\Users\zzzz\Documents\gap>git add README.md
C:\Users\zzzz\Documents\gap>git commit -m "first commit"
interactive rebase in progress; onto 2cb97d3
Last command done (1 command done):
pick 9bdce5c first commit
Next command to do (1 remaining command):
pick 705699b Trigger rebuild # empty
(use "git rebase --edit-todo" to view and edit)
You are currently editing a commit while rebasing branch 'master' on '2cb97d3'.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
nothing to commit, working tree clean
C:\Users\zzzz\Documents\gap>git branch -M master
fatal: Invalid branch name: 'HEAD'
C:\Users\zzzz\Documents\gap>git remote add origin https://github.com/simonshm5/gap-data-science-covid.git
fatal: remote origin already exists.
C:\Users\zzzz\Documents\gap>git push -u origin master
Everything up-to-date
Branch 'master' set up to track remote branch 'master' from 'origin'.
我不知道这些错误是什么意思,也不知道如何修复它们。当我运行
npm start
时,我的程序在localhost
上运行得非常好。现在,我只想推送到Github并将其部署到Github页面上。您会收到此错误,因为您已经在该文件夹中为此项目初始化git。因此,首先必须删除文件夹中的git文件。转到项目文件夹并删除名为“.git”的文件夹。如果看不到该文件夹,请确保启用“显示隐藏的文件、文件夹和磁盘”。之后,你可以遵循以下步骤:你在交互重播的中间游荡。住手。您需要说git-rebase--abort
,然后查看您的实际文件是否受损。如果没有,请扔掉不可见的.git
文件夹。你已经造成了足够的伤害。