git版本1.9.3推送失败

时间:2014-05-11 23:38:38

标签: git push

所以,我克隆了这个存储库https://github.com/rdpeng/ProgrammingAssignment2

并进行了一些更改并在本地提交了我的更改,但我无法将它们推送到我的远程存储库!

这是输出:

git push
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

In Git 2.0, Git will default to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

fatal: remote error: 
  You can't push to git://github.com/mirjalil/ProgrammingAssignment2.git
  Use https://github.com/mirjalil/ProgrammingAssignment2.git

以下是关于我的git和repo的更多信息: git --version

1.9.3

git branch

* master

1 个答案:

答案 0 :(得分:2)

错误在底部说明。

fatal: remote error: 
  You can't push to git://github.com/mirjalil/ProgrammingAssignment2.git
  Use https://github.com/mirjalil/ProgrammingAssignment2.git

您已使用git://网址添加了您的分叉,该网址仅支持阅读,而不支持更新。要正确推送到表单,您需要使用SSH URL或http:// URL。

因此,您可以运行此命令来更改远程指向的URL。

 git remote set-url <fork remote> https://github.com/mirjalil/ProgrammingAssignment2.git

错误消息上方的所有内容与错误完全无关,只是让您了解git 2即将发生的更改,以便在最终更新时不会出现意外行为。