blob: 38fafcaa6b4173ad7f900c71efaa8ea25470072f [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 Hamanod2179ef2010-10-22 04:12:1712'git rev-list' [ \--max-count=<number> ]
13 [ \--skip=<number> ]
14 [ \--max-age=<timestamp> ]
15 [ \--min-age=<timestamp> ]
Junio C Hamano235a91e2006-01-07 01:13:5816 [ \--sparse ]
Junio C Hamano934e1782009-07-16 06:59:1517 [ \--merges ]
Junio C Hamano235a91e2006-01-07 01:13:5818 [ \--no-merges ]
Junio C Hamanof32ce262011-03-27 07:35:1119 [ \--min-parents=<number> ]
20 [ \--no-min-parents ]
21 [ \--max-parents=<number> ]
22 [ \--no-max-parents ]
Junio C Hamano554da792007-12-27 03:29:5823 [ \--first-parent ]
Junio C Hamano9be18972006-01-28 08:54:5724 [ \--remove-empty ]
Junio C Hamanoee695f22007-06-21 00:35:3625 [ \--full-history ]
Junio C Hamano872c5682006-07-07 06:05:4026 [ \--not ]
Junio C Hamano235a91e2006-01-07 01:13:5827 [ \--all ]
Junio C Hamanod2179ef2010-10-22 04:12:1728 [ \--branches[=<pattern>] ]
29 [ \--tags[=<pattern>] ]
30 [ \--remotes[=<pattern>] ]
31 [ \--glob=<glob-pattern> ]
Junio C Hamano084228c2011-05-30 08:13:5232 [ \--ignore-missing ]
Junio C Hamanoc9245d92006-09-06 09:35:4633 [ \--stdin ]
Junio C Hamano8c5802d2007-11-15 00:13:3634 [ \--quiet ]
Junio C Hamanodecf50e2006-03-05 10:51:1435 [ \--topo-order ]
Junio C Hamano235a91e2006-01-07 01:13:5836 [ \--parents ]
Junio C Hamanoee695f22007-06-21 00:35:3637 [ \--timestamp ]
Junio C Hamano5678d692007-04-06 00:51:4338 [ \--left-right ]
Junio C Hamano9a2fb2d2011-03-23 05:40:1539 [ \--left-only ]
40 [ \--right-only ]
41 [ \--cherry-mark ]
Junio C Hamanod9e0e5d2007-04-14 16:22:0442 [ \--cherry-pick ]
Junio C Hamano775a0f42006-12-31 01:19:1443 [ \--encoding[=<encoding>] ]
Junio C Hamano47c1e3c2006-09-25 04:45:5544 [ \--(author|committer|grep)=<pattern> ]
Junio C Hamanoa476efa2008-10-10 15:31:4245 [ \--regexp-ignore-case | -i ]
46 [ \--extended-regexp | -E ]
47 [ \--fixed-strings | -F ]
Junio C Hamanod2179ef2010-10-22 04:12:1748 [ \--date=(local|relative|default|iso|rfc|short) ]
Junio C Hamano5f327762006-03-02 09:14:5149 [ [\--objects | \--objects-edge] [ \--unpacked ] ]
Junio C Hamano235a91e2006-01-07 01:13:5850 [ \--pretty | \--header ]
51 [ \--bisect ]
Junio C Hamano20f64da2007-04-04 18:38:3052 [ \--bisect-vars ]
Junio C Hamano1974bf22007-10-31 05:57:2053 [ \--bisect-all ]
Junio C Hamano859f3b42006-08-04 10:04:3054 [ \--merge ]
Junio C Hamano053827f2007-02-14 07:23:5855 [ \--reverse ]
Junio C Hamanodb450ba2007-01-21 08:57:1456 [ \--walk-reflogs ]
Junio C Hamanoa196f6d2007-07-24 08:10:2757 [ \--no-walk ] [ \--do-walk ]
Junio C Hamano235a91e2006-01-07 01:13:5858 <commit>... [ \-- <paths>... ]
Junio C Hamano1a4e8412005-12-27 08:17:2359
60DESCRIPTION
61-----------
Junio C Hamano89e135d2006-09-03 06:18:2562
Junio C Hamano31cca162009-08-07 05:40:0163List commits that are reachable by following the `parent` links from the
64given commit(s), but exclude commits that are reachable from the one(s)
65given with a '{caret}' in front of them. The output is given in reverse
66chronological order by default.
Junio C Hamano1a4e8412005-12-27 08:17:2367
Junio C Hamano31cca162009-08-07 05:40:0168You can think of this as a set operation. Commits given on the command
69line form a set of commits that are reachable from any of them, and then
70commits reachable from any of the ones given with '{caret}' in front are
71subtracted from that set. The remaining commits are what comes out in the
72command's output. Various other options and paths parameters can be used
73to further limit the result.
74
75Thus, the following command:
Junio C Hamano89e135d2006-09-03 06:18:2576
77-----------------------------------------------------------------------
Junio C Hamanofce7c7e2008-07-02 03:06:3878$ git rev-list foo bar ^baz
Junio C Hamano89e135d2006-09-03 06:18:2579-----------------------------------------------------------------------
80
Junio C Hamano31cca162009-08-07 05:40:0181means "list all the commits which are reachable from 'foo' or 'bar', but
82not from 'baz'".
Junio C Hamano1a4e8412005-12-27 08:17:2383
Junio C Hamano89e135d2006-09-03 06:18:2584A special notation "'<commit1>'..'<commit2>'" can be used as a
85short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of
86the following may be used interchangeably:
Junio C Hamano1a4e8412005-12-27 08:17:2387
Junio C Hamano89e135d2006-09-03 06:18:2588-----------------------------------------------------------------------
Junio C Hamanofce7c7e2008-07-02 03:06:3889$ git rev-list origin..HEAD
90$ git rev-list HEAD ^origin
Junio C Hamano89e135d2006-09-03 06:18:2591-----------------------------------------------------------------------
92
93Another special notation is "'<commit1>'...'<commit2>'" which is useful
94for merges. The resulting set of commits is the symmetric difference
Junio C Hamano872c5682006-07-07 06:05:4095between the two operands. The following two commands are equivalent:
96
Junio C Hamano89e135d2006-09-03 06:18:2597-----------------------------------------------------------------------
Junio C Hamanofce7c7e2008-07-02 03:06:3898$ git rev-list A B --not $(git merge-base --all A B)
99$ git rev-list A...B
Junio C Hamano89e135d2006-09-03 06:18:25100-----------------------------------------------------------------------
101
Junio C Hamano27a128b2009-08-13 01:23:00102'rev-list' is a very essential git command, since it
Junio C Hamano89e135d2006-09-03 06:18:25103provides the ability to build and traverse commit ancestry graphs. For
104this reason, it has a lot of different options that enables it to be
Junio C Hamano1aa40d22010-01-21 17:46:43105used by commands as different as 'git bisect' and
106'git repack'.
Junio C Hamano1a4e8412005-12-27 08:17:23107
108OPTIONS
109-------
Junio C Hamano89e135d2006-09-03 06:18:25110
Junio C Hamanob0e02952008-01-19 08:02:00111:git-rev-list: 1
112include::rev-list-options.txt[]
Junio C Hamano0430e3a2007-05-15 03:13:17113
114include::pretty-formats.txt[]
115
Junio C Hamano1a4e8412005-12-27 08:17:23116GIT
117---
Junio C Hamanof7c042d2008-06-06 22:50:53118Part of the linkgit:git[1] suite