Last Updated: May 1, 2025
GitFlow Branches
| Branch Type | Naming | Lifetime | Merges Into |
|---|---|---|---|
| Main | main / master | Forever (one) | — (production code) |
| Develop | develop | Forever (one) | main (via release) |
| Feature | feature/* | Days to weeks | develop |
| Release | release/* | Days (prep) | main AND develop |
| Hotfix | hotfix/* | Hours | main AND develop |
Feature Branches
git flow feature start nameCreate a new feature branch from develop
git flow feature publish namePush feature branch to remote
git flow feature finish nameMerge feature into develop and delete branch
git flow feature pull origin namePull a collaborator's feature branch
git flow feature track nameTrack a remote feature branch locally
Release Branches
git flow release start 1.0.0Start a release branch from develop
git flow release publish 1.0.0Push release branch to remote
git flow release finish 1.0.0Merge into main AND develop, create tag, delete branch
git flow release track 1.0.0Track a remote release branch locally
Hotfix Branches
git flow hotfix start 1.0.1Start hotfix branch from main
git flow hotfix finish 1.0.1Merge into main AND develop, tag, delete branch
git flow hotfix publish 1.0.1Push hotfix to remote for collaboration
Manual GitFlow (Without Extension)
git checkout -b feature/name developCreate feature from develop
git checkout develop && git merge --no-ff feature/nameFinish feature into develop
git checkout -b release/1.0 developStart release from develop
git checkout main && git merge --no-ff release/1.0Merge release into main
git checkout develop && git merge --no-ff release/1.0Back-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 mainStart hotfix from main
git checkout main && git merge --no-ff hotfix/1.0.1Finish 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.