github添加遠程倉庫報錯:fatal: remote origin already exists.

github添加遠程倉庫報錯:fatal: remote origin already exists.

如果輸入$ git remote add origin [email protected]:XXX/XXXX.git
出現出錯信息:fatal: remote origin already exists.
解決方法:

1、先輸入$ git remote rm origin

2、再輸入$ git remote add origin [email protected]:XXX/XXXX.git

3、如果輸入$ git remote rm origin 還是報錯的話,error: Could not remove config section ‘remote.origin’. 我們需要修改gitconfig文件的內容

4、找到你的github的安裝路徑,..\GitHub\PortableGit_ca477551eeb4aea0e4ae9fcd3358bd96720bb5c8\etc

5、找到一個名爲gitconfig的文件,打開它把裏面的[remote “origin”]那一行刪掉就好了!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章