Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion book/03-git-branching/sections/rebasing.asc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ image::images/basic-rebase-1.png[Simple divergent history.]
The easiest way to integrate the branches, as we've already covered, is the `merge` command.
It performs a three-way merge between the two latest branch snapshots (`C3` and `C4`) and the most recent common ancestor of the two (`C2`), creating a new snapshot (and commit).

[[rebasing-merging-example]]
.Merging to integrate diverged work history
image::images/basic-rebase-2.png[Merging to integrate diverged work history.]

Expand Down Expand Up @@ -48,7 +49,7 @@ $ git merge experiment
.Fast-forwarding the master branch
image::images/basic-rebase-4.png[Fast-forwarding the master branch.]

Now, the snapshot pointed to by `C4'` is exactly the same as the one that was pointed to by `C5` in the merge example.
Now, the snapshot pointed to by `C4'` is exactly the same as the one that was pointed to by `C5` in <<rebasing-merging-example,the merge example>>.
There is no difference in the end product of the integration, but rebasing makes for a cleaner history.
If you examine the log of a rebased branch, it looks like a linear history: it appears that all the work happened in series, even when it originally happened in parallel.

Expand Down