fatal: remote origin already exists. (远程来源已经存在 解决办法)
强烈推介IDEA2020.2破解激活,IntelliJ IDEA 注册码,2020.2 IDEA 激活码
在当我们输入` git remote add origin https://gitee.com/(github/码云账号)/(github/码云项目名).git `
就会报如下的错
fatal: remote origin already exists.
翻译过来就是:致命:远程来源已经存在
此时,我们可以先 git remote -v 查看远程库信息:
可以看到,本地库已经关联了origin
的远程库,并且,该远程库指向GitHub。
解决办法如下:
1、先输入$ git remote rm origin(删除关联的origin的远程库)
2、再输入$ git remote add origin git@github.com:(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"]那一行删掉就好了!
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有