I have a branch in which I’ve been doing some surgery on a single (Python) file, while development continues on the same file in the main branch. Normally this is easily dealt with by git merge, but one of the bigger changes I’ve made was to reorder the classes inside the file. As a result, git’s merge algorithm is getting hopelessly confused. Is there a way to tell it to merge a particular part of the file from one side, with a different part on the other side?
I have a branch in which I’ve been doing some surgery on a single
Share
Using the patience strategy (
-s patience) might help a little, because it matches on the unique lines in the file instead of repeated lines. The other option that comes to mind is to do an interactive rebase (-i) instead of a merge, which lets you go patch by patch if you like. There isn’t an interactive option formerge. Other than that, it’s just one of those situations where you have to bite the bullet and do it the hard way. Using a graphical merge tool can make it a lot easier.