What Git Flow is
Git Flow is a branching model proposed by Vincent Driessen in 2010. It defines five branch types - main, develop, feature/*, release/*, hotfix/* - and rules for how they interact. It suits products with explicit release cycles and parallel maintenance of older versions.
The five branches
main- holds production-ready code. Every commit is a release.develop- integration branch for the next release.feature/*- offdevelop, merged back todevelop.release/*- offdevelop, merged intomainand back todevelop. Final stabilisation.hotfix/*- offmain, merged intomainanddevelop. Production fixes.
A feature lifecycle
git checkout develop
git pull
git checkout -b feature/oauth-login
# ...work, commit, push...
git checkout develop
git merge --no-ff feature/oauth-login
git push origin develop
git branch -d feature/oauth-login
--no-ff preserves the merge commit so the feature is visible as a unit.
A release
git checkout develop
git checkout -b release/1.4.0
# bump version, run final tests, fix bugs only
git checkout main
git merge --no-ff release/1.4.0
git tag -a v1.4.0 -m "Release 1.4.0"
git checkout develop
git merge --no-ff release/1.4.0
git branch -d release/1.4.0
A hotfix
git checkout main
git checkout -b hotfix/1.4.1
# fix the bug
git checkout main
git merge --no-ff hotfix/1.4.1
git tag -a v1.4.1 -m "Hotfix 1.4.1"
git checkout develop
git merge --no-ff hotfix/1.4.1
git branch -d hotfix/1.4.1
The git-flow CLI
The git-flow extension automates the bookkeeping:
brew install git-flow-avh
git flow init
git flow feature start oauth-login
git flow feature finish oauth-login
git flow release start 1.4.0
git flow release finish 1.4.0
When Git Flow fits
- Versioned, downloadable software (desktop apps, libraries).
- Parallel maintenance of multiple supported versions.
- Long QA cycles between feature freeze and release.
When Git Flow does not fit
- Continuously deployed web apps - the
developbranch becomes redundant. - Small teams without a dedicated release process.
- Trunk-based engineering cultures.
Driessen himself revised his recommendation in 2020: for web apps with continuous delivery, prefer GitHub Flow or trunk-based development. Git Flow remains valuable when its assumptions actually hold.
Common pitfalls
- Forgetting to merge a hotfix back to
develop- the bug returns next release. - Long-lived release branches drift from develop, accumulating conflicts.
- Treating
developas if it were main, deploying from it.
Pick Git Flow with eyes open. If it fits, it is a clear, teachable model.