blob: 7a1585def0ce0c0ca78a2735f619f0e8bdf3506c [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 Hamanoc5bb3b32013-08-05 22:43:3643 [ \--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 Hamano5b3533d2014-02-27 23:07:1558 [ \--use-bitmap-index ]
Junio C Hamano235a91e2006-01-07 01:13:5859 <commit>... [ \-- <paths>... ]
Junio C Hamano1a4e8412005-12-27 08:17:2360
61DESCRIPTION
62-----------
Junio C Hamano89e135d2006-09-03 06:18:2563
Junio C Hamano31cca162009-08-07 05:40:0164List commits that are reachable by following the `parent` links from the
65given commit(s), but exclude commits that are reachable from the one(s)
66given with a '{caret}' in front of them. The output is given in reverse
67chronological order by default.
Junio C Hamano1a4e8412005-12-27 08:17:2368
Junio C Hamano31cca162009-08-07 05:40:0169You can think of this as a set operation. Commits given on the command
70line form a set of commits that are reachable from any of them, and then
71commits reachable from any of the ones given with '{caret}' in front are
72subtracted from that set. The remaining commits are what comes out in the
73command's output. Various other options and paths parameters can be used
74to further limit the result.
75
76Thus, the following command:
Junio C Hamano89e135d2006-09-03 06:18:2577
78-----------------------------------------------------------------------
Junio C Hamanofce7c7e2008-07-02 03:06:3879$ git rev-list foo bar ^baz
Junio C Hamano89e135d2006-09-03 06:18:2580-----------------------------------------------------------------------
81
Junio C Hamano31cca162009-08-07 05:40:0182means "list all the commits which are reachable from 'foo' or 'bar', but
83not from 'baz'".
Junio C Hamano1a4e8412005-12-27 08:17:2384
Junio C Hamano89e135d2006-09-03 06:18:2585A special notation "'<commit1>'..'<commit2>'" can be used as a
86short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of
87the following may be used interchangeably:
Junio C Hamano1a4e8412005-12-27 08:17:2388
Junio C Hamano89e135d2006-09-03 06:18:2589-----------------------------------------------------------------------
Junio C Hamanofce7c7e2008-07-02 03:06:3890$ git rev-list origin..HEAD
91$ git rev-list HEAD ^origin
Junio C Hamano89e135d2006-09-03 06:18:2592-----------------------------------------------------------------------
93
94Another special notation is "'<commit1>'...'<commit2>'" which is useful
95for merges. The resulting set of commits is the symmetric difference
Junio C Hamano872c5682006-07-07 06:05:4096between the two operands. The following two commands are equivalent:
97
Junio C Hamano89e135d2006-09-03 06:18:2598-----------------------------------------------------------------------
Junio C Hamanofce7c7e2008-07-02 03:06:3899$ git rev-list A B --not $(git merge-base --all A B)
100$ git rev-list A...B
Junio C Hamano89e135d2006-09-03 06:18:25101-----------------------------------------------------------------------
102
Junio C Hamano076ffcc2013-02-06 05:13:21103'rev-list' is a very essential Git command, since it
Junio C Hamano89e135d2006-09-03 06:18:25104provides the ability to build and traverse commit ancestry graphs. For
105this reason, it has a lot of different options that enables it to be
Junio C Hamano1aa40d22010-01-21 17:46:43106used by commands as different as 'git bisect' and
107'git repack'.
Junio C Hamano1a4e8412005-12-27 08:17:23108
109OPTIONS
110-------
Junio C Hamano89e135d2006-09-03 06:18:25111
Junio C Hamanob0e02952008-01-19 08:02:00112:git-rev-list: 1
113include::rev-list-options.txt[]
Junio C Hamano0430e3a2007-05-15 03:13:17114
115include::pretty-formats.txt[]
116
Junio C Hamano1a4e8412005-12-27 08:17:23117GIT
118---
Junio C Hamanof7c042d2008-06-06 22:50:53119Part of the linkgit:git[1] suite