blob: 025c9114365682cab4feb345c3a69beb5900d299 [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 Hamano6c6b0e52019-10-11 07:28:2512'git rev-list' [<options>] <commit>... [[--] <path>...]
Junio C Hamano1a4e8412005-12-27 08:17:2313
14DESCRIPTION
15-----------
Junio C Hamano89e135d2006-09-03 06:18:2516
Junio C Hamano31cca162009-08-07 05:40:0117List commits that are reachable by following the `parent` links from the
18given commit(s), but exclude commits that are reachable from the one(s)
19given with a '{caret}' in front of them. The output is given in reverse
20chronological order by default.
Junio C Hamano1a4e8412005-12-27 08:17:2321
Junio C Hamano31cca162009-08-07 05:40:0122You can think of this as a set operation. Commits given on the command
23line form a set of commits that are reachable from any of them, and then
24commits reachable from any of the ones given with '{caret}' in front are
25subtracted from that set. The remaining commits are what comes out in the
26command's output. Various other options and paths parameters can be used
27to further limit the result.
28
29Thus, the following command:
Junio C Hamano89e135d2006-09-03 06:18:2530
31-----------------------------------------------------------------------
Junio C Hamanofce7c7e2008-07-02 03:06:3832$ git rev-list foo bar ^baz
Junio C Hamano89e135d2006-09-03 06:18:2533-----------------------------------------------------------------------
34
Junio C Hamano31cca162009-08-07 05:40:0135means "list all the commits which are reachable from 'foo' or 'bar', but
36not from 'baz'".
Junio C Hamano1a4e8412005-12-27 08:17:2337
Junio C Hamano89e135d2006-09-03 06:18:2538A special notation "'<commit1>'..'<commit2>'" can be used as a
39short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of
40the following may be used interchangeably:
Junio C Hamano1a4e8412005-12-27 08:17:2341
Junio C Hamano89e135d2006-09-03 06:18:2542-----------------------------------------------------------------------
Junio C Hamanofce7c7e2008-07-02 03:06:3843$ git rev-list origin..HEAD
44$ git rev-list HEAD ^origin
Junio C Hamano89e135d2006-09-03 06:18:2545-----------------------------------------------------------------------
46
47Another special notation is "'<commit1>'...'<commit2>'" which is useful
48for merges. The resulting set of commits is the symmetric difference
Junio C Hamano872c5682006-07-07 06:05:4049between the two operands. The following two commands are equivalent:
50
Junio C Hamano89e135d2006-09-03 06:18:2551-----------------------------------------------------------------------
Junio C Hamanofce7c7e2008-07-02 03:06:3852$ git rev-list A B --not $(git merge-base --all A B)
53$ git rev-list A...B
Junio C Hamano89e135d2006-09-03 06:18:2554-----------------------------------------------------------------------
55
Junio C Hamano076ffcc2013-02-06 05:13:2156'rev-list' is a very essential Git command, since it
Junio C Hamano89e135d2006-09-03 06:18:2557provides the ability to build and traverse commit ancestry graphs. For
58this reason, it has a lot of different options that enables it to be
Junio C Hamano1aa40d22010-01-21 17:46:4359used by commands as different as 'git bisect' and
60'git repack'.
Junio C Hamano1a4e8412005-12-27 08:17:2361
62OPTIONS
63-------
Junio C Hamano89e135d2006-09-03 06:18:2564
Junio C Hamanob0e02952008-01-19 08:02:0065:git-rev-list: 1
66include::rev-list-options.txt[]
Junio C Hamano0430e3a2007-05-15 03:13:1767
68include::pretty-formats.txt[]
69
Junio C Hamano1a4e8412005-12-27 08:17:2370GIT
71---
Junio C Hamanof7c042d2008-06-06 22:50:5372Part of the linkgit:git[1] suite