-
Book Overview & Buying
-
Table Of Contents
Git for Programmers
By :
Rebasing is nothing more than taking one branch and adding it to the tip of another, where the tip is simply the last commit in the branch. For example, suppose you have the following structure:

Figure 5.1: Git structure
You can't do a fast forward here, because Main has moved on since you branched from it. You can do a true merge, but a true merge adds a commit to your history every time you do one:

Figure 5.2: True merges
A rebase solves the same problem, but without adding merges to the commit history.
Notice that as you review this history, you have to skip over a significant number of commits since they are just merges. Rebase eliminates most of these commits.
Here comes the important part:

Figure 5.3: After the rebase
Change the font size
Change margin width
Change background colour