我无法推送,但我的本地已经更新
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
答案 0 :(得分:2)
您是否重写了某种历史记录(例如:rebase,重命名提交消息等)?
如果是,如果您确定git log
/ gitk
显示正确的提交,那么您可以强制推送:
git push -f origin develop