make "git var" a built-in
[git/dscho.git] / Documentation / git-rev-list.txt
blob78d3f48dfb591a0bb52229b7d16de438e55510e3
1 git-rev-list(1)
2 ===============
4 NAME
5 ----
6 git-rev-list - Lists commit objects in reverse chronological order
9 SYNOPSIS
10 --------
11 [verse]
12 'git rev-list' [ \--max-count=number ]
13              [ \--skip=number ]
14              [ \--max-age=timestamp ]
15              [ \--min-age=timestamp ]
16              [ \--sparse ]
17              [ \--merges ]
18              [ \--no-merges ]
19              [ \--first-parent ]
20              [ \--remove-empty ]
21              [ \--full-history ]
22              [ \--not ]
23              [ \--all ]
24              [ \--branches ]
25              [ \--tags ]
26              [ \--remotes ]
27              [ \--stdin ]
28              [ \--quiet ]
29              [ \--topo-order ]
30              [ \--parents ]
31              [ \--timestamp ]
32              [ \--left-right ]
33              [ \--cherry-pick ]
34              [ \--encoding[=<encoding>] ]
35              [ \--(author|committer|grep)=<pattern> ]
36              [ \--regexp-ignore-case | -i ]
37              [ \--extended-regexp | -E ]
38              [ \--fixed-strings | -F ]
39              [ \--date={local|relative|default|iso|rfc|short} ]
40              [ [\--objects | \--objects-edge] [ \--unpacked ] ]
41              [ \--pretty | \--header ]
42              [ \--bisect ]
43              [ \--bisect-vars ]
44              [ \--bisect-all ]
45              [ \--merge ]
46              [ \--reverse ]
47              [ \--walk-reflogs ]
48              [ \--no-walk ] [ \--do-walk ]
49              <commit>... [ \-- <paths>... ]
51 DESCRIPTION
52 -----------
54 List commits that are reachable by following the `parent` links from the
55 given commit(s), but exclude commits that are reachable from the one(s)
56 given with a '{caret}' in front of them.  The output is given in reverse
57 chronological order by default.
59 You can think of this as a set operation.  Commits given on the command
60 line form a set of commits that are reachable from any of them, and then
61 commits reachable from any of the ones given with '{caret}' in front are
62 subtracted from that set.  The remaining commits are what comes out in the
63 command's output.  Various other options and paths parameters can be used
64 to further limit the result.
66 Thus, the following command:
68 -----------------------------------------------------------------------
69         $ git rev-list foo bar ^baz
70 -----------------------------------------------------------------------
72 means "list all the commits which are reachable from 'foo' or 'bar', but
73 not from 'baz'".
75 A special notation "'<commit1>'..'<commit2>'" can be used as a
76 short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of
77 the following may be used interchangeably:
79 -----------------------------------------------------------------------
80         $ git rev-list origin..HEAD
81         $ git rev-list HEAD ^origin
82 -----------------------------------------------------------------------
84 Another special notation is "'<commit1>'...'<commit2>'" which is useful
85 for merges.  The resulting set of commits is the symmetric difference
86 between the two operands.  The following two commands are equivalent:
88 -----------------------------------------------------------------------
89         $ git rev-list A B --not $(git merge-base --all A B)
90         $ git rev-list A...B
91 -----------------------------------------------------------------------
93 'rev-list' is a very essential git command, since it
94 provides the ability to build and traverse commit ancestry graphs. For
95 this reason, it has a lot of different options that enables it to be
96 used by commands as different as 'git bisect' and
97 'git repack'.
99 OPTIONS
100 -------
102 :git-rev-list: 1
103 include::rev-list-options.txt[]
105 include::pretty-formats.txt[]
108 Author
109 ------
110 Written by Linus Torvalds <torvalds@osdl.org>
112 Documentation
113 --------------
114 Documentation by David Greaves, Junio C Hamano, Jonas Fonseca
115 and the git-list <git@vger.kernel.org>.
119 Part of the linkgit:git[1] suite