git错误解决办法

git学习地址https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/0013752340242354807e192f02a44359908df8a5643103a000

执行

git push -u origin master

出现ERROR: 

Warning: Permanently added the RSA host key for IP address '13.229.188.59' to the list of known hosts.
ERROR: Permission to michaelliao/learngit.git denied to YaoLL.
fatal: Could not read from remote repository.

可能是链接了错误的远程库,这时候要先执行

git remote rm origin

来删除目前链接的远程库,再连接正确的远程库就可以正常提交了

原文:

今天使用git 添加远程github仓库的时候提示错误:fatal: remote origin already exists. 
这里写图片描述

最后找到解决办法如下: 
1、先删除远程 Git 仓库

$ git remote rm origin

2、再添加远程 Git 仓库

$ git remote add origin git@github.com:FBing/java-code-generator

如果执行 git remote rm origin 报错的话,我们可以手动修改gitconfig文件的内容

$ vi .git/config

这里写图片描述

把 [remote “origin”] 那一行删掉就好了。

posted @ 2018-05-30 10:30  姚刘乐  阅读(254)  评论(0)    收藏  举报