
The war that never ended
In 2010, GitFlow was gospel. In 2018, trunk-based development became the darling of high-performers in the State of DevOps Report. In 2026, there are still teams killing themselves with 5000-line PRs that stay open for weeks because "that's our process". Choosing the wrong workflow costs time, quality and morale. Let's compare both honestly.
GitFlow in 2 minutes
Model proposed by Vincent Driessen in 2010. It has long-lived branches and well-defined roles:
main— only receives production releases, tagged.develop— continuous integration branch. Everything passes here before becoming a release.feature/*— branched offdevelop, merged back via PR.release/*— freeze for QA, branched offdevelop, merged intomainand back todevelop.hotfix/*— emergency, branched offmain, merged back tomainanddevelop.
main ────●────────●───── (releases tagged)
\ /
release ●────●
/ \
develop ───●────────●───●── (integration)
\ / /
feature ●────● ●
When it makes sense: products with public versions (mobile apps, downloadable software, libraries with semver), monthly or quarterly releases, large team with dedicated QA, regulated industries (banking, healthcare) that require traceability per release.
Trunk-Based Development in 2 minutes
Model championed by Paul Hammant and popularized by the State of DevOps. The idea is radical: a single main branch, small frequent integrations.
main— always deployable.- Devs create short branches (max 1-2 days of life) and merge directly into
mainvia PR. - Incomplete features sit behind feature flags instead of living in long branches.
- Releases are just tags on specific
maincommits.
main ──●──●──●──●──●──●──●──●── (always deployable)
\ \ \ \
● ● ● ● (short branches, < 2 days)
When it makes sense: web products with continuous deployment (SaaS, APIs), teams that practice CI/CD seriously, reasonable test coverage, fast PR review culture (< 4h).
Direct comparison
| Criterion | GitFlow | Trunk-Based | |---|---|---| | Deploy frequency | Scheduled releases | Multiple per day | | Average PR size | 500-2000 lines | 50-300 lines | | Branch lifetime | Days to weeks | Hours to 2 days | | Merge conflicts | Frequent and painful | Rare | | Test requirement | Manual can slip | Automated mandatory | | Feature flags need | Low | High | | Learning curve | High (5+ branch types) | Low (1 branch + tags) | | Supports multiple production versions? | Yes, naturally | Difficult |
The empirical argument
The State of DevOps Report has been measuring "elite" team characteristics for over 10 years. Consistent findings:
- Elite teams deploy on-demand (multiple times a day).
- Lead time from commit to production: less than 1 hour.
- Change failure rate: < 5%.
- Mean time to recover from incident: less than 1 hour.
These numbers are incompatible with traditional GitFlow. You can't do 10 deploys/day if every release goes through a 3-day QA branch.
But careful: trunk-based only works with serious automation. If you don't have CI running on every commit, reliable tests, and fast rollback capability, it'll be a disaster.
The middle path: GitHub Flow
There's a widely-used middle ground known as GitHub Flow:
mainis deployable.- Devs create feature branches with descriptive names (
fix/login-bug). - PR is opened early, even with the feature incomplete (Draft PR).
- After review and green CI, merge into
main. - Deploy is automatic or manual right after merge.
It's basically trunk-based with slightly longer branches (up to 1 week). Works well for 5-50 dev teams on web products.
Common mistakes on both sides
In GitFlow
feature/*branches that turn into zombies (live for 2 months, no one knows the state).developdrifting too far frommainbecause hotfixes weren't backported.- Giant PRs no one reviews properly ("LGTM" without reading).
- Forgetting to create
release/*and merging straight intomain.
In Trunk-Based
- Merging broken code because "I'll fix it later".
- Feature flags that become permanent tech debt (5 years later there's still
if (FLAG_NEW_CHECKOUT)in the code). - Skipping review because "it's just a small change".
- No rollback capability so when something breaks, everyone's stuck.
How to decide for your team
Ask:
-
Do you ship scheduled versions or deploy continuously?
- Scheduled → GitFlow or GitHub Flow
- Continuous → Trunk-Based or GitHub Flow
-
Does your test suite catch regressions reliably?
- Yes → Trunk-Based viable
- No → stay on GitFlow until tests improve
-
Do you need to maintain multiple versions in production (v1, v2, v3)?
- Yes → GitFlow
- No → Trunk-Based
-
How long does your PR wait for review?
- < 4h → Trunk-Based viable
- Days → fix that before changing workflow
Conclusion
There's no "best" workflow. There's a workflow that matches your team's maturity. GitFlow is robust for rigid contexts. Trunk-Based is agile for modern contexts. GitHub Flow is the sweet spot for most web teams. Choose based on data, not fashion. And whatever you choose, discipline and automation matter more than the branch name.


