簡體   English   中英

Git Bash:遠程錯誤:你無法推送到git://github.com/

[英]Git Bash: remote error: You can't push to git://github.com/

請幫幫我,我該如何解決這個錯誤?

$git push origin dev
fatal: remote error:
 You can't push to git://github.com//name_of_repo.git
 Use https:://github.com//name_of_repo.git

使用HTTPS或SSH URL。 而不是git://github.com/user/repo.git使用以下其中一個:

  • https://github.com/user/repo.git
  • git@github.com:user/repo.git

您可以在克隆中更改它,如下所示:

git remote set-url origin <THE-URL-HERE>

我有同樣的錯誤,這對我有用,我在這里找到了: https//coderwall.com/p/7begkw/fatal-remote-error-you-can-t-push-to-git

git remote rm origin 
git remote add origin git@github.com:user/repo.git
git push origin master

來自github的錯誤消息非常具有誤導性。 它建議使用https://即使用戶可以通過ssh密鑰更容易地進行身份驗證。 使用ssh的(希望是優越的)替代方案如下所示:

git remote set-url origin ssh://git@github.com/user/repo.git

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM