Information Technology Reference
In-Depth Information
The even more verbose way to specify included and excluded revisions is to use --
not operator. The command:
$ git log a b c --not d --not e --not f
prints the revisions included in a , b , or c and excluded from d , e , and f . This can also
be written as:
$ git log a b c ^d ^e ^f
Using the above syntax you can list new revisions introduced in the master , fea-
ture , and brave-idea branches with the command shown in Listing 7-3 . This
command outputs revisions:
f6 , f5 , f4 —commits introduced in feature branch
b2 , b1 —commits introduced in brave-idea branch
m5 , m4 —commits introduced in master branch
Listing 7-3. The command to list new commits introduced in the master, feature, and
brave-idea branches
$ git log --oneline
master feature brave-idea
^`git merge-base master feature`
^`git merge-base feature brave-idea`
How do we achieve the above result? We include all three branches:
master feature brave-idea
and then exclude commits available through the common ancestor of the master and
feature branches (it is revision m3):
^`git merge-base master feature`
And exclude commits available through the common ancestor of the feature and
brave-idea branches (it is revision f3 ):
 
 
Search WWH ::




Custom Search