Trunk Based Development
4 days ago
- #Continuous Integration
- #Source Control
- #Trunk-Based Development
- Trunk-Based Development (TBD) is a source-control branching model where developers collaborate on a single branch called 'trunk' (or 'main' in Git).
- TBD avoids merge conflicts and broken builds by discouraging long-lived development branches.
- It is a key enabler of Continuous Integration (CI) and Continuous Delivery (CD), ensuring the codebase is always releasable.
- Small teams may commit directly to the trunk, while larger teams use short-lived feature branches for code review and CI checks.
- Release branches may be created just-in-time for hardening, or teams may release directly from the trunk with a 'fix forward' strategy.
- Techniques like feature flags and branch by abstraction support longer-term changes without breaking the build.
- TBD is scalable; large organizations like Google and Facebook use it with thousands of developers in a single repository.
- TBD differs from GitFlow and GitHub-flow, emphasizing direct trunk commits or short-lived branches.
- The model has been in use since the mid-90s, supported by advances in source-control tools.
- This site consolidates TBD facts, rationale, and techniques, including diagrams, without using 'TBD' as an acronym.