Trunk-Based Development
Trunk-based development is a source-control practice in which a team integrates small changes into one shared main branch. It limits long-lived branches so conflicts and defects surface while each change is still easy to understand.
itDevOps and software delivery | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Intro
Trunk-Based Development
Trunk-based development organizes collaboration around one shared branch called the trunk. In Git repositories, teams often name that branch main.
The important idea is not the branch name. It is the integration rhythm. You keep changes small, integrate them frequently, and treat the trunk as the current shared state of the product.
This practice addresses a basic coordination problem. Two changes can work in isolation and still fail when combined. Long-lived branches postpone that discovery. By the time they merge, their authors may need to reconcile weeks of changed assumptions.
Trunk-based development shortens that delay. It turns integration from a late project phase into a normal part of daily work.
The core model
Picture the repository as a stream:
small change → review and test → trunk → shared feedback
↑ ↓
└──────── adjust the next change ──┘
Each integrated change gives the team a new shared baseline. The next change begins from that baseline instead of from a private version of the product.
DORA describes trunk-based development through observable behavior. Teams keep very few active branches. Those branches have short lifetimes. Teams also avoid code freezes or stabilization periods caused by difficult integration.
The dedicated Trunk Based Development reference describes two compatible working styles:
Continue the course
This section is part of the paid course.
See pricing to subscribe, or log in if you already have access.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://trunkbaseddevelopment.com/
Supports
- Definition of one shared trunk and the direct-to-trunk and short-lived-branch styles
- Relationship to continuous integration, feature flags, branch by abstraction, and release branches
- Need for pre-integration and trunk verification
- https://dora.dev/capabilities/trunk-based-development/
Supports
- Observable characteristics of short branch lifetime, few active branches, frequent integration, and limited code freezes
- Small-batch development and measures of integration behavior
- https://dora.dev/capabilities/continuous-integration/
Supports
- At-least-daily mainline integration and small batches
- Automated unit tests, fast feedback, and immediate broken-build response
- Common failures involving manual builds, slow checks, and delayed repair
- https://dora.dev/capabilities/continuous-delivery/
Supports
- Trunk-based development as a continuous-delivery capability
- Relationship to test automation and deployment automation
- https://trunkbaseddevelopment.com/short-lived-feature-branches/
Supports
- Prompt merge and deletion of temporary branches
- Single-developer or pair ownership and integration direction toward trunk
- Direct-to-trunk as an alternative for small teams
- https://trunkbaseddevelopment.com/feature-flags/
Supports
- Feature flags as controls for integrating incomplete behavior
- Need to test meaningful flag combinations and remove temporary flags
- https://martinfowler.com/articles/feature-toggles.html
Supports
- Separation of code deployment from feature release
- Release-toggle use in trunk-based development
- Testing burden, carrying cost, ownership, and cleanup of feature flags
- https://trunkbaseddevelopment.com/branch-by-abstraction/
Supports
- Incremental replacement of longer-running changes through an abstraction
- Limits and cleanup considerations for the technique
- https://trunkbaseddevelopment.com/branch-for-release/
Supports
- Release branches cut from trunk for release maintenance
- Trunk-first fixes followed by selected application to release branches
- Separation of development and release lines
- https://github.com/sindresorhus/awesome
Supports
- Starting index used to discover topic-relevant curated lists
- https://github.com/wmariuss/awesome-devops
Supports
- Discovery of GitHub Actions, GitLab CI, Jenkins, Buildkite, and Unleash as relevant DevOps ecosystem tools
- https://github.com/ligurio/awesome-ci
Supports
- Discovery and comparison context for GitHub Actions, GitLab, Jenkins, and Buildkite
- https://docs.github.com/en/actions/get-started
Supports
- GitHub Actions learning path for workflows, continuous integration, and continuous deployment
- https://docs.gitlab.com/ci/pipelines/
Supports
- Branch, merge-request, merged-result, and merge-train pipeline behavior
- Jobs, stages, runners, and repository-based pipeline configuration
- https://www.jenkins.io/doc/book/pipeline/
Supports
- Pipeline as code in a source-controlled Jenkinsfile
- Pipeline execution for branches and pull requests
- https://buildkite.com/docs/pipelines/getting-started
Supports
- Repository-backed pipeline definitions, steps, builds, jobs, and agents
- https://docs.getunleash.io/concepts/feature-flags
Supports
- Activation strategies, variants, lifecycle states, and cleanup support for feature flags
