TL;DR
Trunk-based development or GitFlow? Compare both by release cadence: DORA evidence, branch lifetimes, feature flags, and where versioned releases still win.
If you release to production more than once a week, use trunk-based development. If you ship versioned releases on a schedule and sometimes have to patch an old version while the next one is still being built, use GitFlow. That is the whole decision, and the rest of this article is the evidence for it: what DORA's research actually found, what each model demands from your team, and where each one quietly breaks.
The mistake is treating this as a taste question, or as a vote on which model is more modern. A branching model is a release-management tool. It exists to answer one question: how does finished work get from a developer's machine to the people using the software, and how does a broken release get fixed without stopping everyone else? Answer that question honestly for your product and the branching model mostly picks itself. Get it wrong and you pay every week, either in merge conflicts and release trains, or in a process that fights the way you actually ship.
The question that decides it: your release cadence
Release cadence is the number that separates the two models. A team that deploys a web service ten times a day and a team that ships a desktop application four times a year are not doing the same job with different preferences; they are doing different jobs, and the branching model that serves one will actively obstruct the other.
The evidence for that split comes from DORA, the DevOps Research and Assessment programme run by Google Cloud, which has surveyed thousands of teams every year since 2014. Its performance profiles are stark: elite performers deploy on demand, often multiple times a day, while low performers deploy somewhere between once a month and once every six months. Speed and stability move together in that data, which is the finding that surprises people most. The teams that deploy most often also tend to fail less and recover faster, because the practices that make frequent deployment safe are the same practices that make each individual deployment safer.
DORA's analysis of its 2016 and 2017 survey data attached specific thresholds to trunk-based development. Teams performed better on delivery speed, stability, and availability when they kept three or fewer active branches in the repository, merged to trunk at least once a day, and had no code freezes and no integration phases. Those three thresholds are the practical definition of the model, and they are worth measuring before you claim to be doing it. LaunchDarkly, summarising DORA's research, reports that elite performers are 2.3 times more likely to work this way. Read the number as a correlation from survey data, not a controlled experiment, but the direction is consistent across a decade of reports.
Before you pick a model, measure your own cadence honestly. Count real releases to real users over the last ninety days, not deploys to staging and not the cadence on your roadmap. If the answer is weekly or faster, the rest of this article leans trunk. If the answer is a scheduled release train with version numbers customers install, it leans GitFlow. The /article/devops-metrics guide covers how to track deployment frequency, change lead time, and change failure rate together, because any one of those numbers can be gamed in isolation.
Trunk-based development, and what it actually requires
Trunk-based development is a source-control branching model where developers collaborate on code in a single branch called trunk, and resist any pressure to create other long-lived development branches by employing documented techniques. That definition comes from trunkbaseddevelopment.com, the reference site maintained by Paul Hammant, and the second half of the sentence is doing the work. The model is not "everyone commits to main and hopes for the best." It is a set of techniques that make committing to main safe.
The techniques, as the site documents them, are specific. Every developer commits to the trunk at least once every 24 hours, which keeps the codebase always releasable on demand. Short-lived branches exist, but only for code review and build checking by continuous integration before the code lands in the trunk, and they live less than a day. Feature flags hide unfinished work so half-built features can merge without reaching users. Branch by abstraction lets a large refactor move through the codebase behind an interface, one small merge at a time. Release branches, when they exist at all, are cut from the trunk on a just-in-time basis, hardened without freezing the whole team, and deleted some time after the release. Teams can also release directly from the trunk and fix forward.
None of that works without a continuous integration gate that every commit passes through. The gate below is the minimum viable version: every push to main and every pull request runs the full test suite and the build, and a red build blocks the merge. If the gate is slow, flaky, or optional, trunk-based development degrades into shared-main chaos, where a broken commit blocks every developer until someone fixes it. The /article/cicd-pipelines guide covers how to structure that pipeline so the gate stays fast enough to run on every change.
name: trunk-gate
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
gate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: npm ci
- run: npm test
- run: npm run build
The model scales further than most teams assume. The trunk-based development site cites Google's single monorepo trunk, used by 35,000 developers and QA automators, as proof that the model holds at the largest scale, and Facebook practices it too. Scale is not the reason to avoid it. The reasons to avoid it are the prerequisites: fast automated tests, a review culture quick enough to turn a pull request around within a day, and the discipline to keep the trunk green. A team with a forty-minute test suite and a two-day review queue cannot do trunk-based development yet, whatever the branching diagram says. Fix the tests and the review latency first, and the branching model follows.
Trunk-based development fits web applications and services that deploy continuously, teams that want small batches and fast feedback, and any product where the cost of a bad deploy is low because a fix can ship within the hour. It does not fit a team that cannot yet run its tests on every commit, or a product where a release is a legal event with a fixed version number.
GitFlow, and who it was built for
GitFlow is a structured branching model popularised by Vincent Driessen in his January 2010 post "A successful Git branching model." It was designed for software with versioned releases, and that origin explains every part of it. The model has two long-lived branches and three kinds of supporting branches. Main holds production-ready code, and every commit on main is a released version, usually tagged. Develop is the integration branch where completed features accumulate for the next release. Feature branches come off develop and merge back into it. Release branches are cut from develop when a release is being prepared, exist for final polish only, and merge into both main, with a tag, and develop. Hotfix branches come off main to patch production urgently, and merge back into both main and develop.
main ●────────────────────●──────────────●──▶ tags: v1.0, v1.1, v1.1.1
\ / \ /
release \ ●────●────● \ /
\ / \ /
develop ●────●───●────●──────●────●───●───●──●──▶
\ / \ /
feature ●● ●●
hotfix ●────● (from main)GitFlow shines when you ship distinct, versioned releases: desktop applications, libraries, mobile apps gated by app-store review, or anything with maintained version numbers and the occasional emergency patch. The strongest signal that its structure will pay off is the need to support multiple released versions at once. If version 1.4 is in customers' hands while version 1.5 is being built, you need a place to fix 1.4 without shipping 1.5 early, and GitFlow gives you exactly that place. The explicit release and hotfix branches make release management visible at the cost of more ceremony.
The model's own author scoped it in March 2020, adding a note to the top of the original post. Driessen wrote that web apps are typically continuously delivered, not rolled back, and that you do not have to support multiple versions of the software running in the wild, and suggested that teams doing continuous delivery adopt a much simpler workflow, like GitHub flow, instead of trying to shoehorn GitFlow into their team. He did not retract the model. He said it was built for a different class of software than the web apps most teams now build. That distinction is the honest version of the "GitFlow is dead" argument, and it is also the reason GitFlow is still the right answer for the software it was designed for.
Head-to-head: where each model wins and loses
The table below is the decision in one view. Read it as a set of trade-offs, not a scorecard, because each row favours a different kind of product.
| Question | Trunk-based development | GitFlow |
|---|---|---|
| Release cadence it assumes | On demand, many times a day | Scheduled, versioned releases |
| Long-lived branches | One: main | Two: main and develop |
| Branch lifetime | Under 24 hours | Feature branches live until the release |
| How unfinished work ships | Feature flags, branch by abstraction | Stays on a feature branch |
| Release process | Release from trunk, or a just-in-time release branch | Cut a release branch, stabilise, tag, merge back twice |
| Hotfix path | Fix forward on trunk, or a short release branch | Hotfix branch from main, merged to main and develop |
| What breaks first | CI, flags, or review speed | Merge conflicts and develop/main drift |
| Best for | Web apps and services that deploy continuously | Versioned software with multiple releases in the wild |
Three rows deserve more than a cell. First, merge pain. In trunk-based development, merges are small because the gap between starting work and merging it is measured in hours, so conflicts stay tiny. In GitFlow, a feature branch that lives for three weeks accumulates three weeks of divergence, and the merge at the end of it is where the pain lands. Second, the hotfix path. GitFlow's hotfix branch is the cleanest emergency fix in any branching model, because it touches nothing in flight. Trunk-based development answers the same need by fixing forward, which works only when a fix can reach production quickly. If your release train takes two weeks to reach users, fixing forward is not a hotfix strategy. Third, visibility. GitFlow makes the state of a release legible in the branch list: you can see what is in development, what is being stabilised, and what is live. Trunk-based development makes that state invisible in the branch list and moves it into flags, dashboards, and release tooling, which is a real cost if your team navigates by branches.
The hidden costs both models charge
Neither model is free, and the costs arrive in different currencies. Trunk-based development charges in discipline and infrastructure. Feature flags accumulate: after a year, the code carries checks for features that shipped six months ago, and every flag is an extra state to test and a cleanup task someone has to do. The CI gate has to be fast and trusted, which means investing in test speed and flake reduction. Code review has to be quick, because a pull request that sits for two days has already broken the 24-hour rule. And the trunk has to stay green, which means someone owns the build and the team treats a red trunk as a stop-the-line event, not background noise.
import { flags } from "./flags";
export function checkoutPage(user: User) {
if (flags.newCheckout.enabled(user.id)) {
return renderNewCheckout(user);
}
return renderOldCheckout(user);
}The snippet above is the whole mechanism, and it is also the whole risk. The flag decouples deploying code from releasing behaviour, which is what makes short-lived branches possible for large features. But a flag left on after launch is dead code with a live switch, and a flag left off for months is a second version of the product nobody tests. Retire flags on a schedule, or they become permanent configuration.
GitFlow charges in merge debt and coordination. Two long-lived branches have to be kept in sync, and every release branch merges twice, into main and back into develop, which doubles the opportunities for a merge to go wrong. The develop branch drifts from main between releases, so the release branch exists to close a gap that the model itself created. Release trains encourage batching, and batching encourages the code freeze, which DORA's data associates with worse delivery performance. And the ceremony is real: five branch types, each with its own rules about where it comes from and where it merges, is a process a new hire has to learn before they can ship.
How to switch without breaking the team
Switching models is a migration, not a flag day, and the safe direction depends on where you are starting. Moving from GitFlow to trunk-based development means shrinking branch lifetime first: set a rule that no branch lives longer than two days, then one day, and watch what breaks. Usually the test suite breaks first, because it was never fast enough to run on every change. Then the review queue breaks, because it was never quick enough to turn a change around in a day. Fix those two, add feature flags for the work that cannot be sliced small, and delete develop only after the trunk has stayed green for a few weeks without it. Deleting develop on day one and hoping the rest follows is how teams end up with the surface of trunk-based development and none of the practices that make it work.
Moving the other way is rarer and simpler: adopt GitFlow's release branches only when you actually have a second version to support. A team that ships a versioned SDK or an on-prem product can add a release branch at the point a version needs stabilising, without adopting the whole model at once. If you never support two versions simultaneously, you do not need the ceremony, and adding it early is pure overhead. The /article/gitops guide covers how release promotion works once the branching model is settled, because the branch layout and the deployment pipeline have to agree about what a release is.
One warning applies in both directions: do not let the branching model become the thing the team argues about instead of the release process. If deploys are slow, painful, or feared, the branching model is rarely the root cause. Fix the pipeline, the tests, and the rollback path first, and the branching choice gets easier, because it stops being a workaround for a deployment process nobody trusts.
Architecture decision: pick by cadence, not habit
Decision
Use trunk-based development as the default for services that deploy continuously, and GitFlow only for versioned software where multiple releases are supported at once.
Context
The team ships one product with one release cadence, and the branching model has to match how that product actually reaches users. DORA's research associates trunk-based practices with better delivery performance, but only alongside fast tests, daily integration, and no code freezes. GitFlow was designed for versioned releases and its own author scoped it away from continuously delivered web apps in 2020.
Options considered
Trunk-based development with feature flags, branch by abstraction, and a CI gate on every commit. GitFlow with main and develop, feature, release, and hotfix branches. GitHub Flow as a middle ground: short-lived branches off main with pull requests, no develop branch, no release branches.
Why this one
Trunk-based development is the default because it minimises merge pain and matches the cadence most web services actually ship at, and its costs are investments in testing and review speed that pay off regardless of the model. GitFlow wins only when the product's release shape demands it: version numbers customers install, app-store review gates, or multiple versions in the wild that need independent patches.
What it costs you
Trunk-based development costs a fast, trusted CI gate, feature-flag discipline with scheduled retirement, and review turnaround measured in hours. GitFlow costs merge debt, develop and main drift, release-train overhead, and a five-branch process every new hire has to learn.
When to reverse it
Reverse trunk-based development for GitFlow when the product gains a second supported version, or when releases become scheduled versioned events with review gates outside the team's control. Reverse GitFlow for trunk-based development when the team starts deploying continuously and the release branch has become a ceremony around a deploy that could have come straight from the trunk.
Recommendation and when not to use either
The recommendation follows the cadence. If you deploy to production weekly or faster, adopt trunk-based development, and treat the prerequisites as the actual project: test speed, review turnaround, and flag hygiene. If you ship versioned releases on a schedule, keep GitFlow, and do not let anyone shame the team into trunk-based development because it is newer. The model's own author says it was built for your kind of software.
There are also cases where neither model is the answer, or where the answer is a simpler one. A solo developer or a two-person team can commit directly to main and skip the branching debate entirely; the process exists to coordinate people, and two people coordinate by talking. A team with no automated tests should not adopt trunk-based development, because the model assumes a CI gate that can catch a bad commit, and without it the trunk goes red and stays red. A team whose releases are governed by compliance sign-off should not pretend a branching model removes that gate; it only changes where the gate sits. And if your team deploys once a month because the pipeline is slow and frightening, changing branches will not help. Fix the pipeline first, measure the cadence honestly, and then let the cadence pick the model. That is the whole decision, and it has been the whole decision since Driessen wrote his post in 2010.
Why This Matters
Understanding the business and technical context helps you make informed decisions rather than blindly following patterns.
Trade-offs to Consider
Every architectural decision involves trade-offs. Consider your specific requirements, team expertise, and scale when evaluating options.
When NOT to Use This
Knowing when a solution doesn't apply is as valuable as knowing when it does. Consider alternatives for your specific situation.
Decision Framework
Use this framework to evaluate whether this approach is right for your use case based on your specific constraints and requirements.