我已经开始学习Ruby on Rails和Git。无法将更改推送到远程Git回购
每当我尝试任何更改推到我在Github远程回购,我遇到以下错误:
C:\Sites\first>git push origin master
To [email protected]:piy9/Twitter_clone.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:piy9/Twitter_clone.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
注:我添加目录中的所有文件,并提交更改。我还没有使用pull或checkout创建任何单独的分支。
我不是要求解决问题的方法。
做
git push -f or
git push origin +HEAD
为我工作。
我想知道的是,为什么我在尝试推送到原始分支时遇到错误。
此链接可能会有帮助:[Pro Git](http://git-scm.com/book/) – Jost
可能是你必须做git pull然后再试一次 – Amar