Information Technology Reference
In-Depth Information
commits that are included in src and excluded from the part branch. You can mem-
orize it as the difference (src - part) reapplied at dest .
In both cases final src branch can be omitted. If that is the case then the current
branch will be used. The commands:
$ git rebase dest
$ git rebase dest HEAD
are equivalent exactly as are the following commands:
$ git rebase --onto dest part
$ git rebase --onto dest part HEAD
In this chapter, for the first time, we intentionally worked in detached HEAD state.
The off-branch state can be regarded as the means to perform operations such as rebas-
ing in an atomic way. The operation is performed in a detached HEAD state. When
successfully finished we then adjust the branches as needed. Otherwise the branches
are not modified and the operation can be cancelled. More on this appears in chapter 9
during the discussion of conflicts.
Remember that by default, rebasing skips merge commits. If you want you can pre-
serve them using the --preserve-merges option.
In this chapter, as an aside you also learned how to find the common ancestor of two
branches with the $ git merge-base command, and how to specify ranges com-
mits. Ranges of commits can be defined with two special operators .. and ... or in a
more verbose manner.
When you type a..b , it is a set of commits included in b but excluded from a . You
can think of it as a difference (b - a) .
Three dots c...d specify the symmetric difference , that is, the set of two groups
of commits:
• Those available in c but not in d
• And those available in d but not in c
This can be regarded as (c - d) + (d - c) .
The more verbose syntax uses --not operator, shortened as ^ to exclude a branch.
The ranges:
Search WWH ::




Custom Search