我已經開始學習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