git – 更新了本地但无法推送

我无法推动,但我的本地已经更新

git pull origin develop
already up-to-date

在推动

 git push origin develop                  
 ! [rejected]        develop -> develop (non-fast-forward)
 error: failed to push some refs to 'xxxxxxx'
 hint: Updates were rejected because a pushed branch tip is behind its      remote
 hint: counterpart. Check out this branch and 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.

到底是怎么回事 ?

编辑后添加:

git show-branch develop origin/develop :


 ! [develop] Merge branch 'develop' of XXXXX into develop
 ! [origin/develop] Merge branch 'develop' of XXXXX into feature/JavaSDK
 --
 - [origin/develop] Merge branch 'develop' of XXXXX into feature/JavaSDK
 + [origin/develop^2^2] [MPSC-2189]
 + [origin/develop^2^2^] [MPSC-2189]
 + [origin/develop^2^2~2] [MPSC-2189] location page 
 + [origin/develop^2~2] locations and service manager
 + [origin/develop^2^2~4] [MPSC-2189] edit location page
.....
 + [origin/develop~35^2^] [MPSC-2177]
-- [develop] Merge branch 'develop' of XXXXX into develop

最佳答案 你做过某种历史重写(例如:rebase,重命名提交消息等)吗?

如果是,如果您确定git log / gitk显示正确的提交,那么您可以执行强制推送:

git push -f origin develop 
点赞