1
$git push origin master
To [email protected]:dimitar9/first_app.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:%USERNAME/first_app.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
謝謝哈馬爾和韋斯,但怎麼能忽略所有的遠程變化?我只是想強制推送我的本地版本。我可以這樣做嗎? – 2012-01-08 04:41:36
你不能。遠程服務器配置爲「僅快進更新」。有兩種方法可以解決這個問題。 (a)做Hammar和Wes提出的建議,或者(b)推到新的分支。 – 2012-01-08 04:54:13
其實,你可以,但你不應該:https://help.github.com/articles/dealing-with-non-fast-forward-errors – 2012-08-21 17:37:41