今天使用Git 添加遠程github倉庫的時候提示錯誤:fatal: remote origin already exists.
最後找到解決辦法如下:
1、先刪除遠程 Git 倉庫
$ git remote rm origin
2、再添加遠程 Git 倉庫
$ git remote add origin [email protected]:FBing/Java-code-generator
如果執行 git remote rm origin 報錯的話,我們可以手動修改gitconfig文件的內容
$ vi .git/config
把 [remote “origin”] 那一行刪掉就好了。