github常見操作和常見錯誤!錯誤提示:fatal: remote origin already exists.

如果輸入$ git remote add origin [email protected]:djqiang(github帳號名)/gitdemo(項目名).git

提示出錯信息:fatal: remote origin already exists.
解決辦法如下:

  1. 先輸入$ git remote rm origin
  2. 再輸入$ git remote add origin [email protected]:djqiang/gitdemo.git 就不會報錯了!
  3. 如果輸入$ git remote rm origin 還是報錯的話,error: Could not remove config section ‘remote.origin’. 我們需要修改gitconfig文件的內容
  4. 找到你的github的安裝路徑,找到一個名爲gitconfig的文件,打開它把裏面的[remote “origin”]那一行刪掉就好了!
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章