GitFlow Workflow Cheat Sheet

GitFlow branching model — main, develop, feature, release, and hotfix branches. Structured release management for teams with scheduled releases.

Last Updated: May 1, 2025

GitFlow Branches

Branch TypeNamingLifetimeMerges Into
Mainmain / masterForever (one)— (production code)
DevelopdevelopForever (one)main (via release)
Featurefeature/*Days to weeksdevelop
Releaserelease/*Days (prep)main AND develop
Hotfixhotfix/*Hoursmain AND develop

Feature Branches

git flow feature start name
Create a new feature branch from develop
git flow feature publish name
Push feature branch to remote
git flow feature finish name
Merge feature into develop and delete branch
git flow feature pull origin name
Pull a collaborator's feature branch
git flow feature track name
Track a remote feature branch locally

Release Branches

git flow release start 1.0.0
Start a release branch from develop
git flow release publish 1.0.0
Push release branch to remote
git flow release finish 1.0.0
Merge into main AND develop, create tag, delete branch
git flow release track 1.0.0
Track a remote release branch locally

Hotfix Branches

git flow hotfix start 1.0.1
Start hotfix branch from main
git flow hotfix finish 1.0.1
Merge into main AND develop, tag, delete branch
git flow hotfix publish 1.0.1
Push hotfix to remote for collaboration

Manual GitFlow (Without Extension)

git checkout -b feature/name develop
Create feature from develop
git checkout develop && git merge --no-ff feature/name
Finish feature into develop
git checkout -b release/1.0 develop
Start release from develop
git checkout main && git merge --no-ff release/1.0
Merge release into main
git checkout develop && git merge --no-ff release/1.0
Back-merge release into develop
git tag -a 1.0.0 -m 'Release 1.0.0'
Tag the release commit on main
git checkout -b hotfix/1.0.1 main
Start hotfix from main
git checkout main && git merge --no-ff hotfix/1.0.1
Finish hotfix into main
Pro Tip: GitFlow shines for projects with scheduled releases and multiple versions in production. For continuous deployment, consider GitHub Flow or trunk-based instead.