blob: ef22f1775b634812a6d0595ca3d88ce0b0c51506 [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 Hamano1dbca522015-05-22 20:48:5512'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 ]
Junio C Hamano1eb56092015-10-05 20:39:5348 [ --date=<format>]
Junio C Hamano1dbca522015-05-22 20:48:5549 [ [ --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 ]
Junio C Hamano823eebb2015-07-10 22:29:3459 [ --count ]
Junio C Hamano1dbca522015-05-22 20:48:5560 [ --use-bitmap-index ]
Junio C Hamano235a91e2006-01-07 01:13:5861 <commit>... [ \-- <paths>... ]
Junio C Hamano1a4e8412005-12-27 08:17:2362
63DESCRIPTION
64-----------
Junio C Hamano89e135d2006-09-03 06:18:2565
Junio C Hamano31cca162009-08-07 05:40:0166List 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.
Junio C Hamano1a4e8412005-12-27 08:17:2370
Junio C Hamano31cca162009-08-07 05:40:0171You 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:
Junio C Hamano89e135d2006-09-03 06:18:2579
80-----------------------------------------------------------------------
Junio C Hamanofce7c7e2008-07-02 03:06:3881$ git rev-list foo bar ^baz
Junio C Hamano89e135d2006-09-03 06:18:2582-----------------------------------------------------------------------
83
Junio C Hamano31cca162009-08-07 05:40:0184means "list all the commits which are reachable from 'foo' or 'bar', but
85not from 'baz'".
Junio C Hamano1a4e8412005-12-27 08:17:2386
Junio C Hamano89e135d2006-09-03 06:18:2587A 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 Hamano1a4e8412005-12-27 08:17:2390
Junio C Hamano89e135d2006-09-03 06:18:2591-----------------------------------------------------------------------
Junio C Hamanofce7c7e2008-07-02 03:06:3892$ git rev-list origin..HEAD
93$ git rev-list HEAD ^origin
Junio C Hamano89e135d2006-09-03 06:18:2594-----------------------------------------------------------------------
95
96Another special notation is "'<commit1>'...'<commit2>'" which is useful
97for merges. The resulting set of commits is the symmetric difference
Junio C Hamano872c5682006-07-07 06:05:4098between the two operands. The following two commands are equivalent:
99
Junio C Hamano89e135d2006-09-03 06:18:25100-----------------------------------------------------------------------
Junio C Hamanofce7c7e2008-07-02 03:06:38101$ git rev-list A B --not $(git merge-base --all A B)
102$ git rev-list A...B
Junio C Hamano89e135d2006-09-03 06:18:25103-----------------------------------------------------------------------
104
Junio C Hamano076ffcc2013-02-06 05:13:21105'rev-list' is a very essential Git command, since it
Junio C Hamano89e135d2006-09-03 06:18:25106provides the ability to build and traverse commit ancestry graphs. For
107this reason, it has a lot of different options that enables it to be
Junio C Hamano1aa40d22010-01-21 17:46:43108used by commands as different as 'git bisect' and
109'git repack'.
Junio C Hamano1a4e8412005-12-27 08:17:23110
111OPTIONS
112-------
Junio C Hamano89e135d2006-09-03 06:18:25113
Junio C Hamanob0e02952008-01-19 08:02:00114:git-rev-list: 1
115include::rev-list-options.txt[]
Junio C Hamano0430e3a2007-05-15 03:13:17116
117include::pretty-formats.txt[]
118
Junio C Hamano1a4e8412005-12-27 08:17:23119GIT
120---
Junio C Hamanof7c042d2008-06-06 22:50:53121Part of the linkgit:git[1] suite