Rebase only part of a branch

The actual command would be:

git rebase --onto newbranch1 branch1 branch2

That will replay on top of new_branch1 all commits after branch1 up to branch2 HEAD.

As Joshua Goldberg puts it in the comments:

 git rebase --onto <place-to-put-it> <last-change-that-should-NOT-move> <change to move>

As Denis Sivtsov illustrates in the comments:

If you need only replay the last commit only from branch, in this case work:

git rebase --onto newbranch1 HEAD~1

Leave a Comment

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