From my main feature branch, I started a new feature branch. When I completed this feature, I started another new feature branch. Is it possible to change the branch point of the second sub-feature branch so that it branches from the main feature branch?
i.e., I have this:
A --> B --> C --> D --> E --> F
^ ^ ^
| | |
Head of Head of Head of
feat0 feat1 feat2
I want to turn it into this:
.--> E --> F
/
A --> B
\
`--> C --> D
The changes in C
and D
are (almost) mutually exclusive to those in E
and F
.
I thought that maybe rebase --onto
would do the trick. At F
I did git rebase --onto B
. That moved the head of feat2
to B, losing E
and F
; definitely not what I want!
My second thought is that I could do an interactive rebase at F
from B
, dropping C
and D
, tweaking any commits that cause conflicts. That seems to have worked, but it was unnecessarily messy and involved.
Is there a better way?