[Github] fatal: remote error: You can't push to git 解決辦法

branch正確的情況下, 不知爲什麼,在push的時候總是出現:

  1. fatal: remote error:  
  2. You can't push to git://github.com/user_name/user_repo.git  
  3. Use [email protected]:user_name/user_repo.git  
的提示, 解決辦法:

  1. $ git remote rm origin  
  2. $ git remote add origin [email protected]:user_name/user_repo.git  
  3. $ git push origin  

ok!
經過高人的點播,找到了原因:

如果在git clone的時候用的是

git://github.com:xx/xxx.git 

的形式, 那麼就會出現這個問題,因爲這個protocol是不支持push的

  1. $git clone [email protected]:username/myNCCL.git  
就可以用git push了。
發佈了5 篇原創文章 · 獲贊 13 · 訪問量 20萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章