When using git i like to work with Vincent Driessen ’s a successful git branching model . But since my projects varies i switch between git and another version control system, and sometimes need a quick refresh to get up to speed with git again. So this is the short version of the successful branching model.
Create feature branch $ git checkout -b myfeature develop
Switched to a new branch "myfeature"
Merge feature branch $ git checkout develop
Switched to branch 'develop'
$ git merge --no-ff myfeature
Updating ea1b82a..05e9557
( Summary of changes)
$ git branch -d myfeature
Deleted branch myfeature ( was 05e9557) .
$ git push origin develop
Create release branch $ git checkout -b release-1.2 develop
Switched to a new branch "release-1.2"
$ ./bump-version.sh 1.2
Files modified successfully, version bumped to 1.2.
$ git commit -a -m "Bumped version number to 1.2"
[ release-1.2 74d9424] Bumped version number to 1.2
1 files changed, 1 insertions( +) , 1 deletions( -)
Finish release branch $ git checkout -b release-1.2 develop
Switched to a new branch "release-1.2"
$ ./bump-version.sh 1.2
Files modified successfully, version bumped to 1.2.
$ git commit -a -m "Bumped version number to 1.2"
[ release-1.2 74d9424] Bumped version number to 1.2
1 files changed, 1 insertions( +) , 1 deletions( -)
Create hotfix branch $ git checkout -b hotfix-1.2.1 master
Switched to a new branch "hotfix-1.2.1"
$ ./bump-version.sh 1.2.1
Files modified successfully, version bumped to 1.2.1.
$ git commit -a -m "Bumped version number to 1.2.1"
[ hotfix-1.2.1 41e61bb] Bumped version number to 1.2.1
1 files changed, 1 insertions( +) , 1 deletions( -)
Finish hotfix branch $ git checkout master
Switched to branch 'master'
$ git merge --no-ff hotfix-1.2.1
Merge made by recursive.
( Summary of changes)
$ git tag -a 1.2.1
$ git checkout develop
Switched to branch 'develop'
$ git merge --no-ff hotfix-1.2.1
Merge made by recursive.
( Summary of changes)
$ git branch -d hotfix-1.2.1
Deleted branch hotfix-1.2.1 ( was abbe5d6) .
successful git branch model
Image from http://nvie.com/posts/a-successful-git-branching-model/
I hope you find this post valuable. If you click the ad below I get paid by someone else and can continue to publish posts for free. I would appreciate it very much.