I have a feature branch (in red) that a developer has been working on, and they periodically re-pulled from dev
branch as other feature branches were started and completed in the intervening time, to minimize them from getting too far out of sync. (In iOS projects, certain Xcode-generated files are endless sources of hard-to-resolve merge conflicts, so it helps immensely to keep the branches from diverging too far.) It is not terribly relevant here, but dev
branch (blue) has moved on even further.
I would like to rebase (and squash) this feature branch off of dev
now that it is done. (Yes, I know that some teams prefer to just merge, but we have always rebased/squashed our feature branches.)
I've been doing this pattern for years, and it has worked fine. Everytime dev
marches on, we rebase our various feature branches, and all is well.
But, with these merge commits, it seems that every git rebase -i xxxxxxx
that I try is reporting a ton of previously resolved merge conflicts. Sure, I can imagine having merge conflicts for stuff that has taken place subsequent to this feature branch (above, off the top of the screen, in blue), but I would have thought that I should at least be able to rebase/squash back to some shared commit, e.g., e57aa49 (or a1fbff9 or 51b1aaa) with zero merge conflicts (as the dev has already resolved those conflicts when they did their interim merges). But the presence of these two merge commits (e61e820 and 60deb25) seem to be causing headaches. And when git rebase -i xxxxxxx
, these two merge commits do not even appear in the list (so I can't explicitly pick, squash, or drop them). But I've tried all the logical permutations (picking just the red commits and dropping the blue ones, for example), and I always end up with merge conflicts in a code base that seems like it should have zero merge conflicts.
So, how do I rebase/squash this feature branch (currently at 2718a7a) to e57aa49, for example, without having to go through a ton of merge conflicts that the dev has already resolved?
Effectively, I'm looking to end up with something like the following (which I can then easily rebase to dev
). But I just don't want to have to deal with merge conflicts that have already been resolved.