Filters
How to search
  • Plain words find names, texts and examples.
  • "two words" finds the exact phrase.
  • --name or -x finds an option.
  • #word looks only inside commands.
  • @grep finds lessons and labs that use grep.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Put ! before a word to leave it out. OR between words means one of them.
  • ↑ ↓ to move · Enter to open · Esc to close · / to search

Release & build engineeringDevOps series

Trunk-based vs GitFlow

The branch model argument is about how often code meets main. Trunk-based development merges every day; GitFlow defers the meeting to a release branch.

Quick reference

TRUNK-BASEDGITFLOW
ModelOne trunk, short PRsMany long-lived branches
IntegrationMerged daily to mainMerged at release time
ReleaseA tag on mainA stabilised branch
HotfixFix on main, tag againBranch, then merge twice
Merge painSmall and constantLarge and deferred
Best forContinuous deliveryVersioned, scheduled releases

TRUNK-BASED (One branch, merges every day): Everyone merges to main daily; a release is a tag on main.

git switch -c feat/sso

GITFLOW (Long-lived release branches): Develop, release and hotfix branches, each merged twice.

git flow release start 1.4
  • Trunk → merge daily, release from one commit.
  • GitFlow → stabilise a branch, then merge twice.

Explained

The models

Trunk-based: one long-lived branch, short-lived feature branches, and a merge to main at least daily. Releases are cut from a commit on main, usually with a tag. It depends on fast CI and flags, because unfinished work must ship dark safely.

GitFlow: main, develop, feature, release and hotfix branches. Features merge into develop; a release branch is cut and stabilised; main only ever holds what shipped; a hotfix branches from main and merges back into both main and develop.

What changes

Integration. Trunk-based finds conflicts in hours; GitFlow finds them at release time, when the branch has drifted. Release. A trunk release is a tag on main; a GitFlow release is a branch that receives only fixes. Hotfix. Trunk fixes forward on main and tags again; GitFlow fixes on a hotfix branch and merges twice.

Choosing

Trunk-based fits continuous delivery, a strong test suite and flags that hide unfinished work. GitFlow fits versioned software with several supported releases, or a cadence that needs a stabilisation window. Most teams adopting GitFlow for a web service keep the branches and lose the cadence.

The honest caveat: GitFlow is not wrong, but it is often chosen for the diagram rather than the release schedule, and long-lived branches make the merge the riskiest event in the quarter.

The lesson: choose the branch model that matches how often you want to integrate, not how the diagram looks.

Merge daily, or merge in fear.

More notes: Release & build engineering

Open in the notes app: search, filters, copy This note on GitHub