Given I have a setup like so
A---B---C---D develop
\
E---F---G---H---I feature/123
\
J---L---M feature/124
And feature/123 is squash merged (N) into develop leaving feature/124 with extra commits
A---B---C---D---N develop
\
E---F---G---H---I feature/123
\
J---L---M feature/124
Assuming you have feature/124 checked out, you can use git rebase --onto develop feature/123
to end up with
A---B---C---D---N develop
\
J---L---M feature/124
What's actually taking place when you run the command:
- set
develop
(currently at N) (arg 1) as the new base branch for your current branch -feature/124
--onto
is saying resetfeature/124
on to
develop
's tip
- set
feature/123
(currently at I) (arg 2) as the starting point for the new commits
- All changes made by commits in
feature/124
but that are not infeature/123
(J, L, and M) are saved to a temporary area.
- replay the commits in the temporary area to branch
feature/124