I was working on a feature branch in this structure:
a -- b -- c -- d <-- master
\ \
\ e -- f <-- feature
\
g <-- new_parent
But I need to switch my branches to be in this way:
a -- b -- c -- d <-- master
\
g <-- new_parent
\
e -- f <-- feature
Note that my feature
branch comes from master
that is ahead of new_parent
because I rebased it from master
and new_parent
will be rebased into master
once all the work is done in the feature
branch and rebased to new_parent
.
I'm not that familiar with git, and I don't want to mess my repo, I read about git rebase onto
command, but I'm not sure if the below command will do what I'm trying to do.
git rebase --onto new_parent feature master