无法将提交推送到分叉回购

Nat*_*eed 1 git github

我分叉然后克隆了一个github仓库,我做了一些更改,提交了它们,然后尝试推送:

Nates-MacBook-Pro-2:ReReplay nate$ git push origin master
fatal: remote error: 
  You can't push to git://github.com/natereed/ReReplay.git
  Use git@github.com:natereed/ReReplay.git
Nates-MacBook-Pro-2:ReReplay nate$
Run Code Online (Sandbox Code Playgroud)

错误消息是什么意思?

lar*_*sks 8

该错误似乎表明了一个解决方案:

You can't push to git://github.com/natereed/ReReplay.git 
Use git@github.com:natereed/ReReplay.git
Run Code Online (Sandbox Code Playgroud)

这意味着git://URL通常是"匿名的" - 它们不支持身份验证,因此在Github上你不能写入它们.要写入存储库,您需要使用ssh(git@github.com:...)或http 访问它.

当然,这假定您的GitHub帐户已获得对存储库的写访问权.

您可以重新配置存储库的本地副本以使用ssh URL,如下所示:

git remote set-url origin git@github.com:natereed/ReReplay.git
Run Code Online (Sandbox Code Playgroud)