Thursday, 28 August 2014

Git - when to merge and rebase

http://www.derekgourlay.com/archives/428

" Rebases are how changes should pass from the top of hierarchy downwards and merges are how they flow back upwards. "


Rule of thumb:

  • When pulling changes from origin/master onto your local branch, use rebase.
  • When finishing a feature branch merge the changes back to develop.


Rebase

git pull --rebase
or
git fetch origin
git rebase -p origin/[master]


Merge

git checkout master
git merge [branch]

No comments:

Post a Comment