Consider a scenario where while merging a branch lets say feature
into master
(git megre origin/feature
) and after resolving conflicts, if someone pushes into the master branch again during this process. Now, we cannot push the merge into master as they have diverted again. I see these options in these scenarios.
git rebase origin/master
- This will screw up the whole merge history.git merge origin/master
- But now we have two merge commits in the history and the second one is in most cases unnecessary.- Discard all your work, fast forward you local branch to latest master and merge again with feature branch.
Is there anything obvious I am missing which is cleaner and does not requires to redo the merge conflict work we just did?