Merge changes when a file on a branch has split into two files on the master

Posted by carleeto on Stack Overflow See other posts from Stack Overflow or by carleeto
Published on 2010-06-01T22:22:42Z Indexed on 2010/06/02 5:03 UTC
Read the original article Hit count: 277

Filed under:
|
|
|

This is basically the result of a massive class C on the master having been refactored down the line into two smaller classes, C1 and C2. C was then made a subclass of C2 and cut down to a skeletal version for backward compatibility. So from that point on, master contained C, C1 and C2. On that master commit git said C was renamed to C1. The branch was last updated before this happened. (All C++ code, if it helps to visualize the files involved)

Obviously, when I tried a rebase of the branch onto master, there were conflicts that needed to be resolved.

As usual, I used mergetool.

So now the mergetool comes up with the following: On Local, I have the skeletal version of C. Base and Remote have a bunch of changes to C.

Because the skeletal version of C exists on Local, I conclude that the changes from Base and Remote should actually go into C1, leaving C alone.

My question is, how do I do this?

© Stack Overflow or respective owner

Related posts about git

Related posts about rebase