]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-rev-list.txt
rev-parse --glob
[thirdparty/git.git] / Documentation / git-rev-list.txt
CommitLineData
2cf565c5
DG
1git-rev-list(1)
2===============
2cf565c5
DG
3
4NAME
5----
6git-rev-list - Lists commit objects in reverse chronological order
7
8
9SYNOPSIS
10--------
353ce815 11[verse]
69e0c256 12'git-rev-list' [ \--max-count=number ]
d5db6c9e 13 [ \--skip=number ]
353ce815
JF
14 [ \--max-age=timestamp ]
15 [ \--min-age=timestamp ]
16 [ \--sparse ]
2657420d 17 [ \--merges ]
353ce815 18 [ \--no-merges ]
25db465a 19 [ \--first-parent ]
93b74bca 20 [ \--remove-empty ]
29a6c3f8 21 [ \--full-history ]
0d2c9d67 22 [ \--not ]
353ce815 23 [ \--all ]
a5aa930d
UKK
24 [ \--branches ]
25 [ \--tags ]
26 [ \--remotes ]
d08bae7e 27 [ \--glob=glob-pattern ]
42cabc34 28 [ \--stdin ]
27350891 29 [ \--quiet ]
765ac8ec 30 [ \--topo-order ]
353ce815 31 [ \--parents ]
e3c1500f 32 [ \--timestamp ]
b24bace5 33 [ \--left-right ]
55a643ed 34 [ \--cherry-pick ]
7cbcf4d5 35 [ \--encoding[=<encoding>] ]
bd95fcd3 36 [ \--(author|committer|grep)=<pattern> ]
5d6b3a9e
SG
37 [ \--regexp-ignore-case | -i ]
38 [ \--extended-regexp | -E ]
39 [ \--fixed-strings | -F ]
1701872f 40 [ \--date={local|relative|default|iso|rfc|short} ]
ec579767 41 [ [\--objects | \--objects-edge] [ \--unpacked ] ]
353ce815
JF
42 [ \--pretty | \--header ]
43 [ \--bisect ]
457f08a0 44 [ \--bisect-vars ]
3ac9f612 45 [ \--bisect-all ]
d249b455 46 [ \--merge ]
9c5e66e9 47 [ \--reverse ]
4d12a471 48 [ \--walk-reflogs ]
8e64006e 49 [ \--no-walk ] [ \--do-walk ]
353ce815 50 <commit>... [ \-- <paths>... ]
2cf565c5
DG
51
52DESCRIPTION
53-----------
8c02eee2 54
1a3d834f
JH
55List commits that are reachable by following the `parent` links from the
56given commit(s), but exclude commits that are reachable from the one(s)
57given with a '{caret}' in front of them. The output is given in reverse
58chronological order by default.
2cf565c5 59
1a3d834f
JH
60You can think of this as a set operation. Commits given on the command
61line form a set of commits that are reachable from any of them, and then
62commits reachable from any of the ones given with '{caret}' in front are
63subtracted from that set. The remaining commits are what comes out in the
64command's output. Various other options and paths parameters can be used
65to further limit the result.
66
67Thus, the following command:
8c02eee2
JF
68
69-----------------------------------------------------------------------
b1889c36 70 $ git rev-list foo bar ^baz
8c02eee2
JF
71-----------------------------------------------------------------------
72
1a3d834f
JH
73means "list all the commits which are reachable from 'foo' or 'bar', but
74not from 'baz'".
adcd3512 75
8c02eee2
JF
76A special notation "'<commit1>'..'<commit2>'" can be used as a
77short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of
78the following may be used interchangeably:
69e0c256 79
8c02eee2 80-----------------------------------------------------------------------
b1889c36
JN
81 $ git rev-list origin..HEAD
82 $ git rev-list HEAD ^origin
8c02eee2
JF
83-----------------------------------------------------------------------
84
85Another special notation is "'<commit1>'...'<commit2>'" which is useful
86for merges. The resulting set of commits is the symmetric difference
0d2c9d67
RS
87between the two operands. The following two commands are equivalent:
88
8c02eee2 89-----------------------------------------------------------------------
b1889c36
JN
90 $ git rev-list A B --not $(git merge-base --all A B)
91 $ git rev-list A...B
8c02eee2
JF
92-----------------------------------------------------------------------
93
57f6ec02 94'rev-list' is a very essential git command, since it
8c02eee2
JF
95provides the ability to build and traverse commit ancestry graphs. For
96this reason, it has a lot of different options that enables it to be
ba020ef5
JN
97used by commands as different as 'git-bisect' and
98'git-repack'.
69e0c256 99
df8baa42
JF
100OPTIONS
101-------
8c02eee2 102
fdcf39e5
MV
103:git-rev-list: 1
104include::rev-list-options.txt[]
331b51d2
JN
105
106include::pretty-formats.txt[]
107
108
2cf565c5
DG
109Author
110------
111Written by Linus Torvalds <torvalds@osdl.org>
112
113Documentation
114--------------
8c02eee2
JF
115Documentation by David Greaves, Junio C Hamano, Jonas Fonseca
116and the git-list <git@vger.kernel.org>.
2cf565c5
DG
117
118GIT
119---
9e1f0a85 120Part of the linkgit:git[1] suite