Trouble with merge/rebase a feature branch from master

In january i have created a collada branch where i am reworking large parts of the collada module. I made about 85 commits in that branch so far. The last rebase to master was in april.

However recently there was some change in master that affected also the collada module. And some kind person changed the collada module in master so that it still works there. And now i am trying to add those changes to the collada branch.

i tried with rebasing first:

git pull origin master --rebase

This gives me merge conflicts for almost every commit that i ever made in the collada branch. To make it clear: The rebase starts, then stops on the first commit. There i can fix the merge conflicts and go ahead with

git add <the resolved conflicting files>
git merge --continue

the merge then stops at the 2nd commit. This goes on and on for almost every commit i made in the collada branch.

I also tried with merge:

git fetch --all
git checkout collada
git merge master

While this works with only a few conflicts, at the end i see the collada branch reports that it has added about 700 commits from master, which doesn’t sound good either.

So i decided to go the long way and do the rebasing and fix the merge conflicts as they appear, commit by commit. I got the first 26 commits reworked so far but that took me the whole morning.

Now i wonder if what i do is the correct way to go, or if i miss something important here.

[edit]: I could just save the collada files from my branch, then delete the branch and create it again based on the current master. Then i could drop the saved collada files into the branch and fix the merge conflicts once. But then i would loose the branch history. I am not sure if this is a better way to go…

I still could need a hint on what to do in my case…

After talking with Ideasman42 i decided to keep on going with rebase.

The benefit is that i will not loose any commits from my own branch. Also i will not add duplicates of commits from the master branch into my branch. And it seems (this is my guess) like the final merge back from my branch to the master branch will be straight forward and will only add my own commits.

Maybe this can help others (who are not so git save) when they get into a similar situation. My personal lesson from this is: do not pause when working on a feature branch :sunglasses:

That’s about the only advice that I would have - keep your branch as up-to-date as possible.