Git rebase branch with merged children

不羁岁月 提交于 2019-12-03 05:51:06
VonC

Note that you need a git1.7.6+ for git rebase --preserve-merges to work properly.

Long story short: You just completed a merge and somebody has pushed a commit before you were able to push yours. The solution is to make git aware of the merge you did.

git rebase --preserve-merges <upstream>

or

git rebase -p <upstream>

But there's a problem, if your merge had conflicts that you solved they won't be picked up by the rebase machinery.
And you will end up resolving the conflicts again ... at least this is the case with git version 1.7.5.4

(That would call for git rerere)

Did you cherrypick every commit one by one by hand?

Just run git rebase -i master feature and rewrite the history as you please.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!