I'm merging upstream changes to my project, and recently there were a lot of commits that created a lot of merge conflicts. It doesn't make sense to try to resolve them all at once.
How can I find out which commits create a conflict? Any of the following are acceptable:
You can gives git imerge a try: that will apply your commits one by one, giving you the chance to do a rebase incrementally (meaning you can start a rebase, interrupt it, resume it later!).
You can see here a comparison between Incremental merge vs. direct merge vs. rebase.
Michael Haggerty also has a tool called git-mergemate
that has a find-conflict
command:
git-mergemate find-conflict BRANCH1..BRANCH2
Use bisection to determine the earliest commit on
BRANCH2
that causes a conflict when merged toBRANCH1
. Don't actually retain any merges.
git-mergemate find-conflict BRANCH1...BRANCH2
Use bisection to find a pair of earliest commits (one from each branch) that do not merge cleanly. Don't actually retain any merges.
git imerge
can be used to do an incremental merge and resolve conflicts along the way, though it does not have the equivalent of find-conflicts
in git-mergemate
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With