What Is Trunk-Based Development?
Trunk-based development is a branching strategy where everyone integrates small changes into a single main branch frequently, avoiding long-lived branches.
Trunk-based development keeps the team working close to one shared branch, the trunk. Instead of feature branches that live for weeks, developers make small changes and merge them daily or even multiple times a day. It is the branching model that best supports fast, continuous integration.
The core idea
There is one trunk, usually called main, that always stays releasable. Work happens on very short-lived branches or directly on the trunk behind feature flags, and merges back quickly. The goal is to minimize the time changes spend apart from the trunk.
A short-branch workflow
A change branches off, gets reviewed and tested, and merges within a day or so.
git switch -c fix/typo
git commit -am "Fix typo in header"
# open PR, pass CI, merge same dayWhy it works
Because everyone integrates often, merges stay tiny and conflicts rare. The trunk reflects the latest reality at all times, so there is no painful big-bang integration. Incomplete features are hidden behind feature flags rather than parked on long branches.
Trunk-based development and CI/CD
This model depends on a fast, trustworthy pipeline: if every small change merges quickly, CI must verify each one in minutes and keep the trunk green. In return, the trunk is always close to shippable, which is exactly what continuous delivery needs. Fast runners make the tight feedback loop practical.
Making it work
- Keep branches alive for hours or a day, not weeks.
- Hide unfinished work behind feature flags.
- Invest in fast CI so frequent merges stay verified.
- Treat a broken trunk as a stop-the-line event.
Key takeaways
- Trunk-based development integrates small changes into one main branch often.
- It minimizes long-lived branches and the conflicts they cause.
- It depends on fast CI to keep the always-releasable trunk green.