Git Bash: remote error: You can't push to 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