我按照以下步骤操作:
$ cd $Home/projects/
$ git clone https://github.com/someUser/someRepo.git
$ git add .
fatal: Not a git repository (or any of the parent directories): .git
$ git commit -m "first commit"
fatal: Not a git repository (or any of the parent directories): .git
deepakb.. 6
请遵循以下步骤:
step 1 : cd to $Home/projects/ step 2: git clone https://github.com/someUser/someRepo.git step 3: cd someRepo step 3: git add . step 4: git commit -m "first commit"
注意:在您的情况下,前两个步骤是正常的.但之后你必须做到cd someRepo
移动到git repo目录.在那里你可以添加文件.
错误:您收到错误,fatal: Not a git repository (or any of the parent directories): .git
因为根据您的步骤,您$Home/projects/
不在git存储库中.克隆后git clone https://github.com/someUser/someRepo.git
,它将创建一个名为someRepo
in 的目录$Home/projects/
.那$Home/projects/someRepo
不是git存储库$Home/projects/
.
请遵循以下步骤:
step 1 : cd to $Home/projects/ step 2: git clone https://github.com/someUser/someRepo.git step 3: cd someRepo step 3: git add . step 4: git commit -m "first commit"
注意:在您的情况下,前两个步骤是正常的.但之后你必须做到cd someRepo
移动到git repo目录.在那里你可以添加文件.
错误:您收到错误,fatal: Not a git repository (or any of the parent directories): .git
因为根据您的步骤,您$Home/projects/
不在git存储库中.克隆后git clone https://github.com/someUser/someRepo.git
,它将创建一个名为someRepo
in 的目录$Home/projects/
.那$Home/projects/someRepo
不是git存储库$Home/projects/
.