TLDR:
git rebase --onto newBase oldBase thingToRebase
if you had this:
X---Y---Z sub-feature
/
E---F---G---H feature
/
A---B---C---D master
but then a git rebase master
on feature
produced this
X---Y---Z sub-feature
/
E---F---G---H feature(previous)
/
A---B---C---D master
\
E'---F'---G'---H' feature(new)
sub-feature
is now based on an outdated version of feature
and you need to rebase it to make H' its new base.
to fix sub-feature
, run this from sub-feature
:
git rebase --onto H' F sub-feature
to end up with this:
X---Y---Z sub-feature
/
E'---F'---G'---H' feature
/
A---B---C---D master
source: http://voidcanvas.com/how-to-rebase-a-branch-when-the-parent-is-rebased-with-another/