Branching sucks. Trunk-based development will boost your project!
I am now working on a cool startup and I’m really glad we adopt this model.
Trunk-based development
The idea of trunk based development is to collaborate on a single branch called trunk and avoid creating long-lived branches.
Why is it so good?
Trunk-based development helps to avoid many problems that extensive branching creates. Let’s see why branching might be bad:
- Long-lived branches are a nightmare if you wanna move fast! Imagine a branch that is 4 days behind your trunk. Sometimes that might be more than 100 commits. Do you think you have any chance of merging that? This is unacceptable for a startup.
- Long-lived branches create multiple sources of truth. How do you know which changes to pick? But when you got your trunk it’s deadly easy - it always represents the current state of your system - at any point in time! And it’s guaranteed to work, especially if you practice continuous delivery.
On top of that trunk-based development encourages you to rebase often. This means developers always have a clear view of how their changes interact with everyone else’s changes.
It also offers you an opportunity to skip Pull Requests entirely! This is an insane boost to development, but it only works if the developers trust each other and communicate frequently enough. If you do pair programming, there’s really no need to do any code review!