Git Bash:远程错误:您无法推送到 git://github.com/

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/42735837/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 12:40:16  来源:igfitidea点击:

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

gitgit-push

提问by Yura Lisovskiy

Please, help me, how can I fix this error ?

请帮帮我,我该如何解决这个错误?

$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

回答by ThiefMaster

Use an HTTPS or SSH URL. Instead of git://github.com/user/repo.gituse one of these:

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

You can change it in your clone like this:

您可以像这样在您的克隆中更改它:

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

回答by Gabi

I had the same error, and this worked for me, which I found here: https://coderwall.com/p/7begkw/fatal-remote-error-you-can-t-push-to-git

我有同样的错误,这对我有用,我在这里找到:https: //coderwall.com/p/7begkw/fatal-remote-error-you-can-t-push-to-git

git remote rm origin 
git remote add origin [email protected]:user/repo.git
git push origin master

回答by Jürgen Weigert

The error message from github is quite misleading. It suggests to use https:// even when a user can much easier authenticate via ssh keys. The (hopefully superior) alternative with ssh looks like this:

来自 github 的错误消息非常具有误导性。它建议使用 https://,即使用户可以通过 ssh 密钥更轻松地进行身份验证。ssh 的(希望更好的)替代方案如下所示:

git remote set-url origin ssh://[email protected]/user/repo.git