In 30 seconds
- One main branch, always releasable.
- Branches, if used, last a day or less.
- Feature flags hide unfinished work.
How it works
Developers integrate into the main branch (the trunk) at least once a day. Unfinished work is hidden with feature flags or built in small, complete steps.
Why it beats long-lived branches
| Long-lived branches | Trunk-based | |
|---|---|---|
| Merge conflicts | Large, late | Small, early |
| Feedback | Slow | Fast |
| Release readiness | Needs stabilization | Always ready |
What it needs
- Fast continuous integration
- Strong automated tests
- Small changes and quick reviews
DORA research links trunk-based development with higher delivery performance.
Myth vs reality
Myth · Trunk-based means no code review.
Reality · Short-lived branches with fast reviews are common.
Myth · Unfinished features break the trunk.
Reality · Flags and small steps keep the trunk releasable.
Myth · It only works for small teams.
Reality · Large organizations use it at scale.
FAQ
How short is short-lived?
Ideally less than a day.
What about release branches?
Some teams cut them from trunk just before release.
How do we move from GitFlow?
Shorten branch life gradually and add flags.