blob: ef22f1775b634812a6d0595ca3d88ce0b0c51506 [file] [log] [blame]
David Greaves2cf565c2005-05-10 22:32:30 +01001git-rev-list(1)
2===============
David Greaves2cf565c2005-05-10 22:32:30 +01003
4NAME
5----
6git-rev-list - Lists commit objects in reverse chronological order
7
8
9SYNOPSIS
10--------
Jonas Fonseca353ce812005-12-31 18:37:15 +010011[verse]
Jeff King1c262bb2015-05-13 01:01:38 -040012'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 [ --min-parents=<number> ]
20 [ --no-min-parents ]
21 [ --max-parents=<number> ]
22 [ --no-max-parents ]
23 [ --first-parent ]
24 [ --remove-empty ]
25 [ --full-history ]
26 [ --not ]
27 [ --all ]
28 [ --branches[=<pattern>] ]
29 [ --tags[=<pattern>] ]
30 [ --remotes[=<pattern>] ]
31 [ --glob=<glob-pattern> ]
32 [ --ignore-missing ]
33 [ --stdin ]
34 [ --quiet ]
35 [ --topo-order ]
36 [ --parents ]
37 [ --timestamp ]
38 [ --left-right ]
39 [ --left-only ]
40 [ --right-only ]
41 [ --cherry-mark ]
42 [ --cherry-pick ]
43 [ --encoding=<encoding> ]
44 [ --(author|committer|grep)=<pattern> ]
45 [ --regexp-ignore-case | -i ]
46 [ --extended-regexp | -E ]
47 [ --fixed-strings | -F ]
John Keeping4b1c5e12015-09-03 22:48:54 +010048 [ --date=<format>]
Jeff King1c262bb2015-05-13 01:01:38 -040049 [ [ --objects | --objects-edge | --objects-edge-aggressive ]
50 [ --unpacked ] ]
51 [ --pretty | --header ]
52 [ --bisect ]
53 [ --bisect-vars ]
54 [ --bisect-all ]
55 [ --merge ]
56 [ --reverse ]
57 [ --walk-reflogs ]
58 [ --no-walk ] [ --do-walk ]
Lawrence Siebert75d2e5a2015-07-01 02:24:11 -070059 [ --count ]
Jeff King1c262bb2015-05-13 01:01:38 -040060 [ --use-bitmap-index ]
Jonas Fonseca353ce812005-12-31 18:37:15 +010061 <commit>... [ \-- <paths>... ]
David Greaves2cf565c2005-05-10 22:32:30 +010062
63DESCRIPTION
64-----------
Jonas Fonseca8c02eee2006-09-01 00:37:15 +020065
Junio C Hamano1a3d8342009-08-05 09:42:33 -070066List commits that are reachable by following the `parent` links from the
67given commit(s), but exclude commits that are reachable from the one(s)
68given with a '{caret}' in front of them. The output is given in reverse
69chronological order by default.
David Greaves2cf565c2005-05-10 22:32:30 +010070
Junio C Hamano1a3d8342009-08-05 09:42:33 -070071You can think of this as a set operation. Commits given on the command
72line form a set of commits that are reachable from any of them, and then
73commits reachable from any of the ones given with '{caret}' in front are
74subtracted from that set. The remaining commits are what comes out in the
75command's output. Various other options and paths parameters can be used
76to further limit the result.
77
78Thus, the following command:
Jonas Fonseca8c02eee2006-09-01 00:37:15 +020079
80-----------------------------------------------------------------------
Jonathan Niederb1889c32008-06-30 01:09:04 -050081 $ git rev-list foo bar ^baz
Jonas Fonseca8c02eee2006-09-01 00:37:15 +020082-----------------------------------------------------------------------
83
Junio C Hamano1a3d8342009-08-05 09:42:33 -070084means "list all the commits which are reachable from 'foo' or 'bar', but
85not from 'baz'".
Matthias Urlichsadcd3512005-07-29 20:10:46 +020086
Jonas Fonseca8c02eee2006-09-01 00:37:15 +020087A special notation "'<commit1>'..'<commit2>'" can be used as a
88short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of
89the following may be used interchangeably:
Junio C Hamano69e0c252005-10-30 01:03:45 -080090
Jonas Fonseca8c02eee2006-09-01 00:37:15 +020091-----------------------------------------------------------------------
Jonathan Niederb1889c32008-06-30 01:09:04 -050092 $ git rev-list origin..HEAD
93 $ git rev-list HEAD ^origin
Jonas Fonseca8c02eee2006-09-01 00:37:15 +020094-----------------------------------------------------------------------
95
96Another special notation is "'<commit1>'...'<commit2>'" which is useful
97for merges. The resulting set of commits is the symmetric difference
Rene Scharfe0d2c9d62006-07-02 01:29:37 +020098between the two operands. The following two commands are equivalent:
99
Jonas Fonseca8c02eee2006-09-01 00:37:15 +0200100-----------------------------------------------------------------------
Jonathan Niederb1889c32008-06-30 01:09:04 -0500101 $ git rev-list A B --not $(git merge-base --all A B)
102 $ git rev-list A...B
Jonas Fonseca8c02eee2006-09-01 00:37:15 +0200103-----------------------------------------------------------------------
104
Thomas Ackermann2de9b712013-01-21 20:17:53 +0100105'rev-list' is a very essential Git command, since it
Jonas Fonseca8c02eee2006-09-01 00:37:15 +0200106provides the ability to build and traverse commit ancestry graphs. For
107this reason, it has a lot of different options that enables it to be
Thomas Rast0b444cd2010-01-10 00:33:00 +0100108used by commands as different as 'git bisect' and
109'git repack'.
Junio C Hamano69e0c252005-10-30 01:03:45 -0800110
Jonas Fonsecadf8baa42005-10-03 19:16:30 +0200111OPTIONS
112-------
Jonas Fonseca8c02eee2006-09-01 00:37:15 +0200113
Miklos Vajnafdcf39e2008-01-18 23:58:57 +0100114:git-rev-list: 1
115include::rev-list-options.txt[]
Jakub Narebski331b51d2007-05-14 01:25:45 +0200116
117include::pretty-formats.txt[]
118
David Greaves2cf565c2005-05-10 22:32:30 +0100119GIT
120---
Christian Couder9e1f0a82008-06-06 09:07:32 +0200121Part of the linkgit:git[1] suite