1. 程式人生 > 其它 >git 報錯:fatal: remote origin already exists.

git 報錯:fatal: remote origin already exists.

技術標籤:git

執行:git remote add -f origin [email protected]:git專案名.git

報錯:

fatal: remote origin already exists.
//遠端來源已經存在

解決辦法:
1、執行 git remote -v 檢視遠端庫資訊,結果:

origin  [email protected].com:xxx/xxx.git (fetch)
origin  [email protected].com:xxx/xxx.git (push)

本地庫已經關聯了origin的遠端庫 地址

2、 執行 git remote rm origin

刪除關聯的origin的遠端庫
3、再執行:git remote add -f origin [email protected]:git專案名.git

這時就不會報錯了。