git:not a git repository (or any of the parent directories)

我用git add file添加文件时出现了这样错误:

fatal: Not a git repository (or any of the parent directories): .git

提示说没有.git这样一个目录,解决办法如下:

git init就可以了!

也就是说,在命令行敲入git init回车之后,再重新执行添加文件的命令即可。

如下图所示:

从图中可以看出,问题已经解决。

posted @ 2018-08-01 23:59  Curo  阅读(406)  评论(0编辑  收藏  举报