4 ms·
One way to help solve merge conflicts is incremental merge/rebase - bisect the merge to find which commit causes the conflict, then let the programmer solve tha
by pabs3 5y ago
One way to help solve merge conflicts is incremental merge/rebase - bisect the merge to find which commit causes the conflict, then let the programmer solve that, then repeat again. I'm using git-imerge for this, but there is also mergify and a faster fork of it called git-mergify-rebase.
https://github.com/mhagger/git-imerge https://github.com/mhagger/git-imerge
https://github.com/brooksdavis/mergify https://github.com/brooksdavis/mergify
https://github.com/CTSRD-CHERI/git-mergify-rebase https://github.com/CTSRD-CHERI/git-mergify-rebase
- code_biologist 5y agoThank you for the links! I wrote my own crappier helper to "stitch" a conflicted branch back up to date with upstream. These are great. Stitching together individual conflicted commits makes it obvious whether a conflict is purely textual or there's a true semantic conflict. I think a lot of programmers have a panic reaction to merge conflicts, don't think about what the conflict actually is, then introduce bugs through mistaken merges.
- pabs3 5y agoI definitely panic when encountering merge commits, then I remember imerge, abort the commit and work through each individual conflict with imerge. So much less stressful merging a very small conflict than a large one. Of course, this relies on your history splitting changes up into smaller more logical commits instead of mashing together giant commits with lots of unrelated changes.