git - 无法将提交推送到 fork 的 repo

我 fork 然后克隆了一个 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$

错误信息是什么意思?

最佳答案

错误似乎暗示了一个解决方案:

You can't push to git://github.com/natereed/ReReplay.git 
Use git@github.com:natereed/ReReplay.git

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

当然,这假定您的 GitHub 帐户已获得对存储库的写入权限。

您可以像这样重新配置存储库的本地副本以使用 ssh URL:

git remote set-url origin git@github.com:natereed/ReReplay.git

https://stackoverflow.com/questions/14347302/

相关文章:

regex - Clojure 正则表达式匹配

google-apps-script - 使用 google-apps-script 了解文件类型

php - 具有任意数量 URL 段的 Laravel 4 路由

python - 如何使用 GitPython 指定 Commit 的 committed_date

php - 退出 php 命令而不触发关闭函数

list - Scala 列表中的对象类型

haskell - 与 GADT 的模式匹配

regex - Perl 正则表达式问题

coldfusion - 两次显示问题

php - 使用递归将 html_entity_decode 应用于对象和数组