Trunk-Based Development
Updated 2026-08-10
Summary
A practice in which all developers work on one trunk branch and integrate frequently, avoiding the merge conflicts that long-lived branches create.
Definition
A software engineering practice in which developers commit to a single shared trunk branch and integrate their work frequently, rather than maintaining long-lived feature branches. Its core proposition is that frequent integration keeps divergence small, so conflicts are resolved while they are still cheap and defects surface early instead of at a painful merge. The qualifier is that the trunk must be protected by continuous integration and feature flags, otherwise the speed becomes chaos.
Introduction
How to use
- Trunk setup: establish one shared mainline branch that every developer integrates their work into. - Small commits: merge changes frequently in small increments instead of large batches. - Quality gate: rely on continuous integration and automated quality checks to protect the trunk.
Mechanism
Branches that live for weeks accumulate independent changes to the same code, so the eventual merge must reconcile work that has already diverged. Integrating in small increments keeps the divergence near zero, which turns merging into a routine step, and continuous integration catches breakage at the moment it enters rather than at the end.
Practice
In progress 0/1Practice this model in one real situation:
Cases
- Trunk-based development replaces long-lived feature branches with frequent and small integrations into the trunk.
- Hypothetical: A team integrates daily and resolves conflicts before they grow into merge conflicts.
Common pitfalls
- Leaving the trunk unprotected so that broken code spreads to every developer.
- Forcing large features into the trunk at once, or adopting the practice without continuous integration.
Sources
Source support: Explicit
References currently contain only Wikipedia links; primary sources still need review.
- en.wikipedia.orghttps://en.wikipedia.org/wiki/Branching_(version_controlverified
account_treeGenealogyexpand_more
PRIVATE NOTES · Only visible to you
SAVED Q&A
ENTRY Q&A · Private saving available
Ask with a clear boundary
thinkingmodels answers from published entry context only.
Your question is sent to thinkingmodels. The answer uses public entry context only.
RELATED MODELS