Git Branching – Justifying Long-Lived Feature Branches by Merging Master Daily

branchinggit

I've always considered long lived feature branches a symptom of some underlying problem, but I've recently moved jobs and the company I am working for now encourages long lived feature branches. They say it's fine as long as you merge master (well, the Dev branch, but whatever branch we all work off of) into the feature branch daily. They say you don't end up with conflicts that way or if you do they are small conflicts. I don't personally understand this, is there any truth behind the idea that the difficulties surrounding long lived feature branches can be negated by merging master into the branch frequently?

Edit: I'm going to try to clarify what I'm asking because I don't want it to be opinion based. I'm really looking for what issues we might run into by using long lived feature branches, regardless of whether we merge master in daily. I'm also interested in any issues that are avoided by the merging of master into the feature branch.

Best Answer

This will work only and only if: you only have 1 long-lived-feature-branch.

Let's take the following scenario: 3 developers all working on 3 different long-lived-feature-branches. Every day they merge develop into their branch.

And......achieve nothing, because develop will be the same as the day before, unless 1 of those long-lived-feature-branches gets merged into develop.

And then you will have merge conflicts the next day when you want to merge the now new develop into your still going long-lived-feature-branch.