How to rebase after squashing commits in the original branch?

Use the --onto argument to git rebase, which changes the baseline that git replays work on.

git checkout branch0

At this state you should still see C in your git history.

git rebase --onto B' C

This translates to: Take all commits in my current branch since commit C (In your case that’s just D) and play back on top of B’

You can also use the optional <branch> argument to do both the checkout and rebase at once:

git rebase --onto B' C branch0

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)