I have rather big git branch with code that was created on may of this year and never before was merged with master. Compare shows huuuge difference between branch and master: about 50 new files and about 150 modified files. I'm really worried about forthcoming merge.

What can you recommend? Any advises about how better to merge etc.? Have you ever met similar situation? Any, absolutely any notices and advises are highly appreciated.

PS: Repository is under git. The most important parts of project are covered with unit tests. I'm using IDE by JetBrains (if it is important).

  • 1
    How long has it been since master was accessed? Maybe you don't need to merge at all. – Robert Harvey Dec 2 '14 at 20:25
  • @RobertHarvey very funny :) Master was commited many times since I've created the branch. – Kirzilla Dec 2 '14 at 22:08
  • Totally being serious. You already said it's been awhile, otherwise you wouldn't be having this problem. – Robert Harvey Dec 2 '14 at 22:09

Rebase and resolve any conflicts. Then run your tests (you do have tests, right?) on the branch. If everything passes, you're good to merge.


Do a zip-merge.

This is a sequence of merges, that simulate what may have happened if you had merged earlier. The resulting dag will look like a zip.

This is based on the assumption that the sum of the complexity of each small merge is lower than the complexity of a large merge. This will be so if there are a lot of conflicts. If I remember correctly complexity ≈ conflicts² and a² + b² + c² < (a+b+c)²

  • 1
    Interesting... Any resources on the topic of "zip merging"? I've not heard of the concept before. – RubberDuck Dec 3 '14 at 11:22
  • 1
    @RubberDuck I have no idea, the basic concept is to go back in time (using you revision control system), and then slowly return to the present while merging at each step. This greatly reduces the complexity, at the expense of many merges. It also makes it easier for you or someone else to check. However it is better not to have got into such a position, as each branch will have changes that would not have existed, if the merge had already happened. – ctrl-alt-delor Dec 6 '14 at 15:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.