advogato: git rebase --onto
23rd September 2009
badger:
-
This is where the --onto switch comes in, with git-rebase.
For example:
git checkout -b staging master
[make changes]
git checkout -b base_url staging
[make changes]
git rebase --onto master staging
This does: finds all the commits between the current branch (base_url) and staging, switches base_url's HEAD to master, and then reapplies the above found commits. You end up with a base_url branch that looks like it was only branched from master originally.