Wednesday, January 11, 2012

My GIT workflow (w rebase)

This is usually a popular topic: the following is what work for us at https://microhealth.org

..start the new branch from master
git checkout master
git pull
git checkout -b my_new_feature
..work and commit some stuff
git checkout master
git pull
git checkout my_new_feature
git pull
git rebase master
git pull
git commit -m 'rebased from master' 
..work and commit some stuff
git checkout master
git pull
git checkout my_new_feature
git pull
git rebase master
git commit -m 'rebased from master' 
..finish the feature
git checkout my_new_feature
git pull
git checkout master
git pull
git merge my_new_feature

git push origin master 
 
..Just delete your branch because after a rebase in upstream, your branch is no longer used
git branch -D my_new_feature
 
(to delete permanently from the server: git push origin :my_new_feature) 
 
Don’t rebase branches you have shared with another developer:
If you have pushed your work in the new branch, use merge instead.
 
 
Note: I will update the post in the next days.

No comments:

Post a Comment