git 操作报错(fatal: ‘xxx’ does not appear to be a git repository)

1.git pull 更新报错
fatal: ‘xxx’ does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

git 操作报错(fatal: ‘xxx’ does not appear to be a git repository)_第1张图片

2.检查远程关联 git remote -v
$ git remote -v
origin xxx (fetch)
origin xxx (push)
没有关联远程

3.先移除远程的origin
git remote rm origin

4.重新添加远程的origin
在github或者项目所在的管理下面,找到克隆地方,复制ssh地址,添加新的origin
git remote add origin [email protected]:xxx.git
git 操作报错(fatal: ‘xxx’ does not appear to be a git repository)_第2张图片
5.再次查看远程关联 git remote -v
$ git remote -v
origin [email protected]:xxx.git (fetch)
origin [email protected]:xxx.git (push)
看到这个,恭喜你,你已经成功了,可以开心的使用git pull等命令了

你可能感兴趣的:(git,github,ssh)