How to do it...

We will try to rebase our current branch, rebaseExample, on top of the origin/stable-3.1 branch by performing the following steps. Remember that Git will apply the commits that are not available on the branch we are rebasing to; so, in this case, there will be a lot of commits:

  1. Rebase the branch onto origin/stable-3.1 by using the following command:
$ git rebase --interactive origin/stable-3.1
  1. What you will see now is a list of all the commits you will be rebasing onto the origin/stable-3.1 branch. These commits are all the commits between the origin/stable-3.1 and rebaseExample branches. The commits will be applied from top to bottom, hence, the commits will be listed in reverse order—at least compared to what you would ...

Get Git Version Control Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.