本文翻译自:fatal: Not a git repository (or any of the parent directories): .git [duplicate]
This question already has an answer here: 这个问题已经在这里有了答案:
When I tried to push an existing repository on github.com, and it when I entered the command the website prompted me to put into the terminal, I got this error message fatal: 当我尝试将现有存储库推送到github.com上,并且当我输入命令时,网站提示我将其放入终端,我得到了以下致命错误消息:
Not a git repository (or any of the parent directories): .git
If anyone could help me with this, then that would be great, thanks. 如果有人可以帮助我,那就太好了,谢谢。
#1楼
参考:https://stackoom.com/question/1nEtl/致命-不是git存储库-或任何父目录-git-duplicate
#2楼
The command has to be entered in the directory of the repository. 该命令必须在存储库的目录中输入。 The error is complaining that your current directory isn't a git repo 错误提示您当前目录不是git repo
- Are you in the right directory? 您在正确的目录中吗? Does typing
ls
show the right files? 输入ls
是否显示正确的文件? - Have you initialized the repository yet? 您是否已初始化存储库? Typed
git init
? 键入git init
吗? ( git-init documentation ) ( git-init文档 )
Either of those would cause your error. 这些都会导致您的错误。