blob: 3341d1b62f34fa99afcdab91da1191ceacc2c24f [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-rev-list(1)
2===============
3
4NAME
5----
6git-rev-list - Lists commit objects in reverse chronological order
7
8
9SYNOPSIS
10--------
Junio C Hamano235a91e2006-01-07 01:13:5811[verse]
Junio C Hamano1a4e8412005-12-27 08:17:2312'git-rev-list' [ \--max-count=number ]
Junio C Hamano17bbaca2006-12-25 11:36:3113 [ \--skip=number ]
Junio C Hamano235a91e2006-01-07 01:13:5814 [ \--max-age=timestamp ]
15 [ \--min-age=timestamp ]
16 [ \--sparse ]
Junio C Hamano934e1782009-07-16 06:59:1517 [ \--merges ]
Junio C Hamano235a91e2006-01-07 01:13:5818 [ \--no-merges ]
Junio C Hamano554da792007-12-27 03:29:5819 [ \--first-parent ]
Junio C Hamano9be18972006-01-28 08:54:5720 [ \--remove-empty ]
Junio C Hamanoee695f22007-06-21 00:35:3621 [ \--full-history ]
Junio C Hamano872c5682006-07-07 06:05:4022 [ \--not ]
Junio C Hamano235a91e2006-01-07 01:13:5823 [ \--all ]
Junio C Hamano40f54d32008-02-29 09:21:5024 [ \--branches ]
25 [ \--tags ]
26 [ \--remotes ]
Junio C Hamanoc9245d92006-09-06 09:35:4627 [ \--stdin ]
Junio C Hamano8c5802d2007-11-15 00:13:3628 [ \--quiet ]
Junio C Hamanodecf50e2006-03-05 10:51:1429 [ \--topo-order ]
Junio C Hamano235a91e2006-01-07 01:13:5830 [ \--parents ]
Junio C Hamanoee695f22007-06-21 00:35:3631 [ \--timestamp ]
Junio C Hamano5678d692007-04-06 00:51:4332 [ \--left-right ]
Junio C Hamanod9e0e5d2007-04-14 16:22:0433 [ \--cherry-pick ]
Junio C Hamano775a0f42006-12-31 01:19:1434 [ \--encoding[=<encoding>] ]
Junio C Hamano47c1e3c2006-09-25 04:45:5535 [ \--(author|committer|grep)=<pattern> ]
Junio C Hamanoa476efa2008-10-10 15:31:4236 [ \--regexp-ignore-case | -i ]
37 [ \--extended-regexp | -E ]
38 [ \--fixed-strings | -F ]
Junio C Hamano02f130b2007-07-14 08:26:5639 [ \--date={local|relative|default|iso|rfc|short} ]
Junio C Hamano5f327762006-03-02 09:14:5140 [ [\--objects | \--objects-edge] [ \--unpacked ] ]
Junio C Hamano235a91e2006-01-07 01:13:5841 [ \--pretty | \--header ]
42 [ \--bisect ]
Junio C Hamano20f64da2007-04-04 18:38:3043 [ \--bisect-vars ]
Junio C Hamano1974bf22007-10-31 05:57:2044 [ \--bisect-all ]
Junio C Hamano859f3b42006-08-04 10:04:3045 [ \--merge ]
Junio C Hamano053827f2007-02-14 07:23:5846 [ \--reverse ]
Junio C Hamanodb450ba2007-01-21 08:57:1447 [ \--walk-reflogs ]
Junio C Hamanoa196f6d2007-07-24 08:10:2748 [ \--no-walk ] [ \--do-walk ]
Junio C Hamano235a91e2006-01-07 01:13:5849 <commit>... [ \-- <paths>... ]
Junio C Hamano1a4e8412005-12-27 08:17:2350
51DESCRIPTION
52-----------
Junio C Hamano89e135d2006-09-03 06:18:2553
Junio C Hamano31cca162009-08-07 05:40:0154List commits that are reachable by following the `parent` links from the
55given commit(s), but exclude commits that are reachable from the one(s)
56given with a '{caret}' in front of them. The output is given in reverse
57chronological order by default.
Junio C Hamano1a4e8412005-12-27 08:17:2358
Junio C Hamano31cca162009-08-07 05:40:0159You can think of this as a set operation. Commits given on the command
60line form a set of commits that are reachable from any of them, and then
61commits reachable from any of the ones given with '{caret}' in front are
62subtracted from that set. The remaining commits are what comes out in the
63command's output. Various other options and paths parameters can be used
64to further limit the result.
65
66Thus, the following command:
Junio C Hamano89e135d2006-09-03 06:18:2567
68-----------------------------------------------------------------------
Junio C Hamanofce7c7e2008-07-02 03:06:3869$ git rev-list foo bar ^baz
Junio C Hamano89e135d2006-09-03 06:18:2570-----------------------------------------------------------------------
71
Junio C Hamano31cca162009-08-07 05:40:0172means "list all the commits which are reachable from 'foo' or 'bar', but
73not from 'baz'".
Junio C Hamano1a4e8412005-12-27 08:17:2374
Junio C Hamano89e135d2006-09-03 06:18:2575A special notation "'<commit1>'..'<commit2>'" can be used as a
76short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of
77the following may be used interchangeably:
Junio C Hamano1a4e8412005-12-27 08:17:2378
Junio C Hamano89e135d2006-09-03 06:18:2579-----------------------------------------------------------------------
Junio C Hamanofce7c7e2008-07-02 03:06:3880$ git rev-list origin..HEAD
81$ git rev-list HEAD ^origin
Junio C Hamano89e135d2006-09-03 06:18:2582-----------------------------------------------------------------------
83
84Another special notation is "'<commit1>'...'<commit2>'" which is useful
85for merges. The resulting set of commits is the symmetric difference
Junio C Hamano872c5682006-07-07 06:05:4086between the two operands. The following two commands are equivalent:
87
Junio C Hamano89e135d2006-09-03 06:18:2588-----------------------------------------------------------------------
Junio C Hamanofce7c7e2008-07-02 03:06:3889$ git rev-list A B --not $(git merge-base --all A B)
90$ git rev-list A...B
Junio C Hamano89e135d2006-09-03 06:18:2591-----------------------------------------------------------------------
92
Junio C Hamano27a128b2009-08-13 01:23:0093'rev-list' is a very essential git command, since it
Junio C Hamano89e135d2006-09-03 06:18:2594provides the ability to build and traverse commit ancestry graphs. For
95this reason, it has a lot of different options that enables it to be
Junio C Hamanoba4b9282008-07-06 05:20:3196used by commands as different as 'git-bisect' and
97'git-repack'.
Junio C Hamano1a4e8412005-12-27 08:17:2398
99OPTIONS
100-------
Junio C Hamano89e135d2006-09-03 06:18:25101
Junio C Hamanob0e02952008-01-19 08:02:00102:git-rev-list: 1
103include::rev-list-options.txt[]
Junio C Hamano0430e3a2007-05-15 03:13:17104
105include::pretty-formats.txt[]
106
107
Junio C Hamano1a4e8412005-12-27 08:17:23108Author
109------
110Written by Linus Torvalds <torvalds@osdl.org>
111
Junio C Hamano1a4e8412005-12-27 08:17:23112Documentation
113--------------
Junio C Hamano89e135d2006-09-03 06:18:25114Documentation by David Greaves, Junio C Hamano, Jonas Fonseca
115and the git-list <git@vger.kernel.org>.
Junio C Hamano1a4e8412005-12-27 08:17:23116
117GIT
118---
Junio C Hamanof7c042d2008-06-06 22:50:53119Part of the linkgit:git[1] suite