2015-07-10 56 views
2

獲取更新我去推動工作,我的主分支,但我得到這個錯誤:推分支,不受其他倉庫

! [rejected]  master -> master (fetch first) 
error: failed to push some refs to 'https://github.com/Machinas/esprit-rwd' 
hint: Updates were rejected because the remote contains work that you do 
hint: not have locally. This is usually caused by another repository pushin 
hint: to the same ref. You may want to first integrate the remote changes 
hint: (e.g., 'git pull ...') before pushing again. 
hint: See the 'Note about fast-forwards' in 'git push --help' for details. 

我不想獲取更新另一個人COMMITED,因爲它是一個他們的錯誤,我怎麼能推動並忽略那個提交?由於

+0

[Force「git push」覆蓋遠程文件的可能的重複](http://stackoverflow.com/questions/10510462/force-git-push-to-overwrite-remote-files) –

回答

8

如果你真的真的確定,其他的提交是不相關的,你可以做一個力推

git push --force-with-lease <remote> <branch> 

警告:如果其他人已經拉錯犯,你會做他們不高興。而做出錯誤承諾的人應該更好地獲得您的回購的新克隆。

編輯:改爲--force--force-with-lease,因爲後者危險性稍差。這Atlassian blog post解釋了原因。