git远程库与本地联系报错:fatal: Not a git repository (or any of the parent directories): .git

在github上新建了一个仓库,然后相与本地的仓库联系起来

$ git remote add origin https://github.com/lizhong24/mysite2.git

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

总是报这个错

产生原因:一般是没有初始化git本地版本管理仓库,所以无法执行git命令

解决方法:操作之前执行以下命令行: git init

然后执行一下git status查看状态信息,问题解决。

posted on 2018-05-10 21:25    阅读(372)  评论(0编辑  收藏  举报