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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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查看状态信息,问题解决。

以上是关于git远程库与本地联系报错:fatal: Not a git repository (or any of the parent directories): .git的主要内容,如果未能解决你的问题,请参考以下文章

git clone 提示:remote not found fatal repository "……" not found

git 拉取远程分支报错(fatal: '' is not a commit and a branch '' cannot be created from it)(示例

fatal:'origin' does not appear to be a git repository fatal:Could not read from remote repos

[git] fatal:protocol 'https' is not support

git常见问题fatal: Not a valid object name: 'master'.

Git 报错:fatal: refusing to merge unrelated histories