【我的Android進階之旅】AndroidStudio出現“fatal: remote github already exists”的解決方法

今天把github中的一個倉庫刪除,準備通過AndroidStudio重新上傳該項目,但是在上傳的過程中出現了“fatal: remote github already exists”錯誤,谷歌許久終於找到解決方法。


解決方法:

關閉Android Studio,進入電腦中你要上傳的那個項目的目錄,開啓“顯示隱藏文件”的功能,就能看到隱藏的文件夾/.git  ,打開其中的config文件,刪除類似於下面格式的三行:

  1. [remote "origin"]
  2. url = https://github.com/haoge728/CloudMusic.git
  3. fetch = +refs/heads/*:refs/remotes/origin/*

然後保存config文件。重新打開Android Studio,點擊“Share project on GitHub”上傳項目到github,就不會有“ project is already on GitHub ”或者“fatal: remote github already exists”的錯誤提示了。

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