remote origin already exists解决办法

如图翻译过来就是:致命:远程来源已经存在

此时,我们可以先 git remote -v 查看远程库信息:

 

可以看到,本地库已经关联了origin的远程库,并且,该远程库指向GitHub。

解决办法如下:

1、先输入$ git remote rm origin(删除关联的origin的远程库)

2、再输入$ git remote add origin [email protected]:(github名)/(git项目名).git 就不会报错了!

3、如果输入$ git remote rm origin 还是报错的话,error: Could not remove config section 'remote.origin'. 我们需要修改gitconfig文件的内容

4、找到你的github的安装路径,我的是C:\Users\ASUS\AppData\Local\GitHub\PortableGit_ca477551eeb4aea0e4ae9fcd3358bd96720bb5c8\etc

5、找到一个名为gitconfig的文件,打开它把里面的[remote "origin"]那一行删掉就好了!

猜你喜欢

转载自www.cnblogs.com/kaola8023/p/11751067.html
今日推荐