I have a feature branch that has already been merged (in M
) but reverted afterwards (in R
):
S---o-o-----M-o-R-o
\ /
A-----B-C ^ master
^ feature
I want to rebase the feature
branch onto the current master
so I get:
S---o-o-----M-o-R-o-A'-B'-C'
\ /
A-----B-C ^ new master or new branch
^ old master
^ feature
This is similar to the process described in the addendum of revert-a-faulty-merge.txt but instead of basing the new branch on S
I want to base it on the current master
.
According to this question this solution should work:
git rebase --onto stable D fix/123
This is still kind of risky because you need to take the SHA of D (and NOT X for instance).
So I tried git rebase --no-ff --onto master S feature
but it just advanced the feature
label to the master
label and said "Fast-forwarded feature to master" without generating any new commits.
So how can I basically copy the whole feature
branch on top of master?