Practice : Trunk-Based Development
Purpose and Strategic Importance
Trunk-Based Development enables faster, safer, and more reliable software delivery by encouraging frequent integration of small, incremental changes into the main branch. By reducing the lifespan of feature branches and integrating regularly, teams avoid complex merge conflicts, reduce technical risk, and increase delivery flow.
Without this practice, long-lived branches create hidden queues, larger change sets, and merge risks, leading to slower feedback loops, higher failure rates, and delayed value delivery.
Description of the Practice
- Teams work in short-lived branches or directly on the main trunk, integrating changes frequently, ideally multiple times per day.
- Changes are small, well-tested, and designed to be production-ready or safely hidden behind feature flags.
- Continuous Integration (CI) systems validate every change to maintain system stability.
- The main trunk remains in a releasable state at all times, supporting frequent, low-risk deployments.
How to Practise It (Playbook)
1. Getting Started
- Agree on branching policies that minimise branch lifetime and encourage frequent integration.
- Ensure CI pipelines are in place to test and validate every change to the trunk.
- Introduce feature toggles to allow incomplete work to be merged safely.
- Provide training and examples to help teams adopt the practice.
2. Scaling and Maturing
- Monitor merge frequency, build stability, and feedback cycle times.
- Optimise pipelines to ensure fast, reliable feedback on trunk changes.
- Integrate Trunk-Based Development with other delivery enablers such as feature flags and automated testing.
- Address cultural resistance by reinforcing the benefits of small, incremental changes.
3. Team Behaviours to Encourage
- Integrate early and often, ideally multiple times per day.
- Keep changes small, focused, and easy to review.
- Use feature flags to decouple integration from release.
- Prioritise trunk stability and fast feedback for every commit.
4. Watch Out For…
- Long-lived branches that delay integration and create merge conflicts.
- Inadequate CI coverage leading to unstable trunk builds.
- Teams bypassing trunk policies under delivery pressure.
- Confusion between trunk integration and release readiness without feature flags.
5. Signals of Success
- Frequent, small merges to the trunk without significant conflicts.
- Stable trunk builds with fast, reliable CI feedback.
- Faster delivery flow with fewer last-minute integration issues.
- Teams report higher confidence in releasing changes frequently and safely.