Git Flow Summary
Main branches
• master - production-ready
• develop
Supporting branches
• Feature branches
• Release branches
• Hotfix branches
Feature branches
• May branch off from: develop
• Must merge back into: develop
• Branching naming convention: anything except
master, develop, release-*, or hotfix-*
Creating a feature branch
$ git checkout -b myfeature develop
Incorporating a finished feature on
development
$ git checkout develop
$ git merge --no -ff myfeature
$ git branch -d myfeature
$ git push origin develop
1
Release branches
• May branch off from: develop
• Must merge back into: develop and master
• Branching naming convention: release-*
Creating a release branch
$ git checkout -b release -1.2 develop
$ ./bump - version .sh 1.2
$ git commit -a -m " Bumped version number to 1.2"
$ git checkout develop
$ git merge --no -ff release -1.2
$ git branch -d release -1.2
Finishing a release branch
$ git checkout master
$ git merge --no -ff release -1.2
$ git tag -a 1.2
$ git checkout develop
$ git merge --no -ff release -1.2
$ git branch -d release -1.2
Hotfix branches
• May branch off from: master
• Must merge back into: develop and master
• Branching naming convention: hotfix-*
2
Creating the hotfix branch
$ git checkout -b hotfix -1.2.1 master
$ ./bump - version .sh 1.2.1
$ git commit -a -m " Bumped version \
number to 1.2.1"
$ git commit -m "Fixed severe \
production problem "
Finishing a hotfix branch
$ git checkout master
$ git merge --no -ff hotfix -1.2.1
$ git tag -a 1.2.1
$ git checkout develop
$ git merge --no -ff hotfix -1.2.1
$ git branch -d hotfix -1.2.1
Author: Vincent Driessen
Original blog post: https://nvie.com/posts/a-successful-git-branching-model
License: Creative Commons BY-SA
3
release
feature
develop branches hotfixes master
branches
Tag
Time
0.1
Major Severe bug
feature for fixed for
Feature production:
next release
for future hotfix 0.2
release
Incorporate
bugfix in
develop
Tag
0.2
Start of
release
branch for
From this point on, 1.0
“next release”
means the release
after 1.0
Only
bugfixes!
Bugfixes from Tag
rel. branch
may be 1.0
continuously
merged back
into develop
Author: Vincent Driessen
Original blog post: http://nvie.com/posts/a-succesful-git-branching-model
License: Creative Commons BY-SA