DEV Community

Discussion on: Why you should not use (long-lived) feature branches

 
anortef profile image
Adrián Norte • Edited

There is something that always bothered me with feature branching and seeing that you seem pretty convinced of them maybe you can solve this for me.

Developer A and Developer B branch out of master at the start of the sprint to do their job and both pull and merge from master frequently but no one is pushing to master so, how do they know they are not breaking each other stuff?

Thread Thread
 
mortoray profile image
edA‑qa mort‑ora‑y

Keep the branches short-lived and avoid working on the same parts of the code. Avoiding the same parts of the code applies to whatever branching strategy you are using.

There's rarely a need for two people to work on the same bits of code in the same period. This can usually be recognized during triage and planning.

In the unusual case where two people are working on the same code, it should be for the same feature, in which case, they can share a branch. And they should probably sit close to each other in the office and communicate.

The moment one of them feels the need to pull from the other's branch, the warning sirens should go off. It sounds like a monster branch is growing.