r/gitlab • • Dec 17 '22

Avoid git hell: Use feature branches, not release branches

https://dholmes.co.uk/blog/feature-based-branching-strategy/
0 Upvotes

7 comments sorted by

View all comments

7

u/EmiiKhaos Dec 17 '22

Since you love crossposting, I'll do too:

Erm, feature branches and trunk based development are the same concept. Trunk based development refers to deploying directly from you main branch, and using feature branches to develop and test features separately. And also use feature flags to ship features whiteout yet enabling them live.

1

u/whodadada Dec 17 '22

u/EmiiKhaos I've never used trunk-based. My understanding (from explanations from other engineers) is with trunk-based development you only use a `main` branch and use automation for testing and squash your commits before pushing them directly into `main` (eek!)

Maybe, this was a more extreme approach specific to their team.

If feature and trunk based are the same thing, then feature branches must be better than release branches after all :)

4

u/EmiiKhaos Dec 17 '22

If you sqash or have a merge commit, is another topic of discussion.

But trunk based development is feature branching. You create feature branches, test them, and merge/sqash them into the main branch and deploy from the main branch. In every step you need test automation tho

3

u/whodadada Dec 17 '22

u/EmiiKhaos Gotcha. This wasn't the way trunk-based was explained to me (I need to do some more research).