使用github时因fatal: remote origin already exists错误,无法提交
如果輸入$ git remote add origin git@github.com:XXX(github帳號(hào)名)/xxx(項(xiàng)目名).git提示出錯(cuò)信息:fatal: remote origin already exists.
解決辦法如下:
1、先輸入$ git remote rm origin
2、再輸入$ git remote add origin git@github.com:xxx/xxx.git 就不會(huì)報(bào)錯(cuò)了!
3、如果輸入$ git remote rm origin 還是報(bào)錯(cuò)的話,error: Could not remove config section ‘remote.origin’. 我們需要修改gitconfig文件的內(nèi)容
4、找到你的github的安裝路徑,如:\GitHub\PortableGit_ca477551eeb4aea0e4ae9fcd3358bd96720bb5c8搜索\etc5、找到一個(gè)名為gitconfig的文件,打開(kāi)它把里面的[remote "origin"]那一行刪掉就好了!
轉(zhuǎn)載于:https://blog.51cto.com/wuwenhui/1559198
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來(lái)咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)總結(jié)
以上是生活随笔為你收集整理的使用github时因fatal: remote origin already exists错误,无法提交的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 【设计】线框图、原型和视觉稿的区别
- 下一篇: 【小议】centos与ubuntu的区别