Trunk-based development (TBD) is a branching model in which every developer integrates work into one shared branch, the trunk, in small steps and often. The trunk stays in a releasable state at all times. Atlassian describes it as a version control practice where small, frequent updates go to a core branch, and as a required practice for CI/CD. For a CTO or VP of Engineering, the model matters because it decides how quickly changes reach production and how much unreviewed, diverged code can pile up between releases. With AI coding agents now producing changes in volume, that question has become more pressing.
The sections below cover what the practice involves, how teams keep the trunk stable, how it compares with Git Flow, and what changes when agents write part of the code.
Trunk-based development keeps one shared branch releasable
The trunk is the main branch of a repository, often called main or mainline. Since 2020 GitHub and other hosting platforms have named the default branch of new repositories main. In TBD all developers integrate into it, with no long-lived development branch sitting between their work and the shared code.
The MinimumCD practice guide defines TBD as a workflow with no intermediate integration branch. Changes go either directly to the trunk or through very short-lived branches that start from the trunk and return to it. AWS describes the aim as keeping the code base in a continuously releasable state.
The contrast with feature-branch development is easiest to see in how merging works. A long-lived feature branch collects many commits and merges once, when the work is finished. By then the trunk has moved on, and the merge becomes a large event with its own risk of regressions. TBD spreads that merge cost over many small integrations.
A common misreading holds that TBD means everyone commits straight to main without checks. The MinimumCD migration guide says TBD is about integration frequency, not about eliminating controls… They happen in small increments rather than at the end of a long branch.
TBD is also closely tied to continuous integration. Continuous integration means every change is merged and automatically built and tested against the shared code. A team that keeps branches alive for weeks is integrating periodically at best, whatever the tooling says.
Short-lived branches and daily merges set the rhythm
The rhythm of TBD is defined by how long work stays away from the trunk. DORA, the research programme behind the widely used delivery performance metrics, describes developers merging small batches of work at least once a day. Branches in this model typically last a few hours. Feature branches in other models can involve several developers and run for days or weeks.

Small teams sometimes commit directly to the trunk. Larger teams usually add a pull request, which is a proposed change that colleagues review and automated checks run against before it merges. Martin Fowler’s branching patterns article describes both variants. Smaller teams commit to the mainline, while larger teams use short-lived feature branches where short means no more than a couple of days.
Release branches remain possible. DORA describes optional release branches as snapshots of code ready to release, usually merged back to the trunk as soon as possible. Some organisations cut a release branch for stabilisation, while others release straight from the trunk.
The MinimumCD migration guide advises teams moving to TBD to begin with a branch lifetime limit of 48 hours. It then tightens the limit to integration at least once per day. That gradual path reflects a practical point: the habit changes before the tooling does.
What makes small merges possible is how work is cut. A feature that needs two weeks of effort has to be split into pieces that are each safe to merge. That splitting is the hardest skill in the model, and it shapes how stories, designs and reviews are written.
Feature flags and branch by abstraction hide unfinished work
If code merges daily, some of what lands in the trunk will belong to features that are not finished. Two techniques keep that code from reaching users.
A feature flag is a runtime switch that turns a piece of behaviour on or off without a new deployment. Unfinished work merges behind a flag that is off, so it is compiled and tested with everything else. The MinimumCD migration guide treats flags as a release strategy rather than a testing strategy. It adds that both the on and off states need testing, and that release flags are typically removed within a few weeks once the feature is live.
Branch by abstraction handles larger structural changes, such as replacing a payment provider or a data access layer. The team introduces an abstraction in front of the old component. It builds the new component behind that abstraction and moves callers across gradually. Every step leaves the build green, so the trunk never waits on a big-bang switch.
The MinimumCD guide frames this as replacing process with engineering. Branches control release through process: a feature ships when its branch merges. Flags and abstractions control release inside the code, which gives a team a way to switch a feature off in production.
Flags carry their own overhead. Stale flags accumulate into configuration debt, and combinations of flag states multiply test cases. The MinimumCD migration guide suggests removing release flags once the feature is stable, typically within one to four weeks.
Automated checks keep the trunk green
The trunk can only be trusted if every change passes through checks that run quickly and fail loudly. Each merge triggers a build and an automated test suite, and the result is visible to the whole team. A change that breaks the trunk is typically fixed within minutes or reverted, so the shared branch returns to a releasable state.
AWS Prescriptive Guidance describes the dependency plainly. The model relies on automated testing and continuous integration to keep the codebase continuously releasable. Its branching strategy comparison lists increased pressure on testing and less control over releases among the trade-offs of the trunk approach.
A team without that safety net tends to feel the weakness quickly. Slow or flaky tests push developers to batch their changes, which brings long-lived branches back. Weak coverage lets regressions reach the trunk, and the team loses confidence that it is releasable. Fast feedback is therefore treated as part of the branching model itself.
The MinimumCD migration guide adds two supporting practices. Collaborative acceptance criteria, agreed before coding, and executable tests help shorten branch lifetimes. Contract tests, which verify the agreements between services, let teams integrate often without surprises from neighbouring components.
Review also remains part of TBD, and it adapts to the size of the change. A small pull request can be read in minutes and merged the same day. A large one waits for days in a queue.
Git Flow and GitHub Flow suit different release patterns
TBD is one of several branching strategies, and each fits a different release pattern. AWS lists three from least to most complex: trunk, GitHub Flow and Gitflow.
GitHub Flow is lightweight. Developers create short-lived feature branches from main and merge them when the work is ready to deploy. It sits close to TBD, and the main difference lies in how long branches live and where releases are cut from.
Gitflow uses permanent branches, typically main and develop, plus feature, release and hotfix branches. Atlassian notes that it brings more planning and collaboration overhead. Martin Fowler’s article records that Vincent Driessen wrote it in 2010 for projects with several versions in production at once, such as software installed on customer sites. Driessen later added that for a single production web application the structure is more complicated than needed.
The AWS comparison gives each a place. The trunk strategy suits smaller, mature teams with strong communication and continuous rolling releases. It is less suited to large or fragmented teams and to big scheduled releases. Gitflow suits larger, distributed teams with strict release and compliance requirements, or teams maintaining several production versions. It fits rapid continuous deployment poorly, and its long-lived release branches can accumulate technical debt.
The following table compares the three on the points engineering leaders usually weigh.
| Aspect | Trunk-based development | GitHub Flow | Gitflow |
|---|---|---|---|
| Main structure | One shared trunk | Main plus short-lived feature branches | Main, develop, feature, release and hotfix branches |
| Typical branch life | Hours | Days at most | Days to weeks for features |
| Release control | Flags and abstractions in code | Merge to main, then deploy | Release branches |
| Fits | Continuous delivery of a single production version | Web applications deploying often | Multiple supported versions, strict release gates |
Driessen’s note applies most directly to products running a single production version. Teams that ship installed software to customers, or maintain several versions in parallel, have reasons to keep release branches…
Size is a legitimate concern. AWS flags scalability challenges as the team grows with more frequent build breaks and test failures.
AI coding agents raise the pressure on branching discipline
AI coding agents change the arithmetic of branching. An agent can produce several candidate changes in the time a developer once spent on one, and each change still needs to be reviewed and merged. Without a branching model that favours small, frequent integration, that volume turns into a growing set of diverged branches and a slower review queue.
TBD addresses the volume problem in a structural way. Small changes are cheaper to review and easier to revert. They also keep the trunk close to what every other developer and agent is working against, which reduces the merge conflicts that arise when several agents edit the same area independently.
Cleverbit has published a view on AI branch strategy that looks at how agent-written code fits into branching choices. Its Agentic Software Development Field Guide covers the wider practices around agent use.
Test speed and reliability come first, because the trunk is only as safe as its checks. Flag hygiene follows. Agreement on the size of a reviewable change comes next, since that figure decides how quickly the queue moves.
Governing agent-assisted delivery on a shared trunk
A shared trunk concentrates both benefit and risk. One bad merge reaches every developer and, in a continuously deployed SaaS product, potentially every customer. That raises the value of controls that are built into the workflow rather than added after the fact.
Cleverbit works with engineering leaders at large enterprise SaaS companies on exactly this combination: rules for AI use that fit existing engineering standards, review that applies whether code was written by hand or with an agent, and visibility into what AI is doing at each step. The Agentic SDLC page describes the engagement that starts this work.
Common questions about trunk-based development
TBD stands for trunk-based development
The abbreviation refers to the branching model described above, in which developers integrate small changes into a single main branch. Some sources use TBD informally in other senses, but in software delivery it means trunk-based development.
A trunk is the main branch and a branch is a short-lived copy
The trunk is the shared line of code that every change eventually joins, and it is kept releasable. A branch in TBD is a temporary copy used for a small change and merged back within hours or a day or two. DORA contrasts this with feature branches that can span days or weeks.
A trunk-based workflow and trunk-based development describe the same practice
The phrase trunk-based workflow usually emphasises the day-to-day sequence: pull the latest trunk, make a small change, run checks, review and merge. The model underneath is identical. Teams differ mainly in whether they commit directly or use short pull requests.
Large teams can use trunk-based development with pull requests
Martin Fowler’s article notes that larger teams use short-lived feature branching, with branches lasting no more than a couple of days. AWS guidance adds that scale puts extra demands on testing and release control. Large organisations therefore pair the model with fast automated checks, flags and clear ownership of the trunk.