Moving range of commits start-hash
(included) -> end-hash
(included) from branch A
to branch B
First ensure that you pushed all changes from A
and B
to their origins
^
indicates to start exactly from start-hash
git checkout A
git rebase --onto B start-hash^ end-hash
If end-hash
is excluded from rebase
command, it will take all commits from start-hash
to HEAD