我遵循了以下步骤:
$ 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
请按照以下步骤操作:
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/
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句