Back to blog
Development

Trunk-Based vs GitFlow: Which Workflow to Choose in 2026

Bruno Bracaioli
Trunk-Based vs GitFlow: Which Workflow to Choose in 2026

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 off develop, merged back via PR.
  • release/* — freeze for QA, branched off develop, merged into main and back to develop.
  • hotfix/* — emergency, branched off main, merged back to main and develop.
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 main via PR.
  • Incomplete features sit behind feature flags instead of living in long branches.
  • Releases are just tags on specific main commits.
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:

  • main is 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).
  • develop drifting too far from main because hotfixes weren't backported.
  • Giant PRs no one reviews properly ("LGTM" without reading).
  • Forgetting to create release/* and merging straight into main.

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:

  1. Do you ship scheduled versions or deploy continuously?

    • Scheduled → GitFlow or GitHub Flow
    • Continuous → Trunk-Based or GitHub Flow
  2. Does your test suite catch regressions reliably?

    • Yes → Trunk-Based viable
    • No → stay on GitFlow until tests improve
  3. Do you need to maintain multiple versions in production (v1, v2, v3)?

    • Yes → GitFlow
    • No → Trunk-Based
  4. 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.

Compartilhar:

Fique por dentro

Receba novos artigos sobre IA, desenvolvimento e tecnologia direto no seu email.