1

Project is getting bigger and we have several integration branches:

  • master -> released code
  • develop -> code to be released very very soon
  • develop-8_6 -> code to be released in at some point as 8.6 version
  • develop-8_7 -> code to be released in at some point as 8.7 version
  • develop-8_8 -> code to be released in at some point as 8.8 version
  • develop-8_9 -> code to be released in at some point as 8.9 version
  • develop-8_10 -> code to be released in at some point as 8.10 version
  • and so on...

As integration branches, each branch must contain all changes from previous branches. Also, each branch receives pull request from developers (ex dev/8_7featureX). Each feature branch must be reviewed and merging it is usually just a button in gitlab/github. No problem here. My pain-point is when merging one integration branch into the other develop -> develop-8_6 -> develop-8_7 -> ...

So far I have been merging all branches manually, sometimes it is easy, sometimes it takes time due to conflicts, etc. But this is endless, I think having several integration branches is common approach for big projects like Gitlab, etc.

Question:

How can integration branches merge process be automatically done for all future release branches? I read about implementing git receive hooks on the server but it was unclear how to deal with conflicts. Could someone point me in the right direction? Or show some specific examples or approaches to merge all develop branches?

In other words, how people in Gitlab project deal with so many integration branches? How did they automatize it? (Or this is manually done?)

nacho4d
  • 43,720
  • 45
  • 157
  • 240

1 Answers1

1

First, make sure that, if you find yourself fixing the same conflict, you try and activate git rerere ("reuse recorded resolution").

git config --global rerere.enabled true

That will record for you those conflict resolution.

See more at "Fix conflicts only once with git rerere" from Christophe Porteneuve

if you prefer rerere to auto-stage files it solved (I do), you can ask it to: you just need to tweak your configuration like so:

git config --global rerere.autoupdate true

Second, it is best to work with feature branches (as independent one from another as possible), and merge then in one integration branches (a dev branch)
You can see an example in gitworkflow (one word)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • First time I header about rerere. Thank you!. About integration branches, that is what my develop-20200X branches are. :) All feature branches are always independent – nacho4d Apr 18 '20 at 17:35