Cheatography
https://cheatography.com
"A succesful branching model" is a blog post written by nvie. This cheat sheet shows the commands to be used. http://nvie.com/posts/a-successful-git-branching-model/
This is a draft cheat sheet. It is a work in progress and is not finished yet.
Branches
master |
Only final releases |
develop |
Current state of code. Release branch may branch of this one |
Release-x.x.xx |
A release branch. Tagged at creation with version number. Branches of develop once. No new features after branch off |
hotfixes |
Only for important bug fixes. Branches of master, tagged at creation |
Feature-featurename |
Many may exist. Branch of and merge to develop. |
Release Branch
Creating release branch |
checkout release 1.2 from develop |
git checkout -b release-1.2 develop
|
Bump version to 1.2 |
|
Commit |
git commit -a -m "Bumped version number to 1.2"
|
Finishing release branch |
Checkout master |
|
Merge |
git merge --no-ff release-1.2
|
tag version (may use -s
or -u
to sign tag cryptographically) |
|
Merge back to develop as well |
|
|
git merge --no-ff release-1.2
|
delete release branch |
git branch -d release-1.2
|
May branch of develop
Merges into develop
and master
Naming convention: release-*
|
|
Feature Branch
create |
git checkout -b myfeature develop
|
incorporate finished feature |
Checkout develop |
|
Merge feature (no-ff forces new commit) |
git merge --no-ff myfeature
|
Delete feature branch |
|
Push develop |
|
Branches of and merges into develop.
Name anything except master
, develop
, release-
or hotfix-
Hotfix branches
Creating Hotfix Branch |
checkout from master |
git checkout -b hotfix-1.2.1 master
|
Bump version |
./bump-version.sh 1.2.1
|
Commit |
git commit -a -m "Bumped version number to 1.2.1"
|
|
Now fix bug |
Commit bugfix |
git commit -m "Fixed severe production problem" |
Finishing a hotfix branch |
|
|
|
git merge --no-ff hotfix-1.2.1
|
|
|
Include fix in develop |
|
|
|
git merge --no-ff hotfix-1.2.1
|
Delete temporary branch |
git branch -d hotfix-1.2.1
|
May branch of master
Merges into master
and develop
Naming convention: hotfix-*
|