release safely and Iterate quickly with git branches
rene — Sun, 01/10/2010 - 20:58
Branches are cheap in git. This is how I use branches to release safely and iterate quickly
I commit a fix in a dev branch
$ git commit -v -m 'closes #101' $ git branch * dev master
I create a branch called dev-master which will be a new branch where I will do the actual merging of 2 branches. The parent of the dev-master branch will be the dev branch.
$ git checkout -b dev-master Switched to a new branch "dev-master" $ git branch dev * dev-master master
I then merge master
$ git merge master
I change to the master branch and merge dev-master
$ git checkout master Switched to branch "master" $ git merge dev-master
Push to origin and clean up
$ git push origin master $ git branch -d dev-master
If there is a conflict or if I need to back out of the merge I can do all the hard work in the dev-master branch without impacting any other branches.































