blob: 7a1585def0ce0c0ca78a2735f619f0e8bdf3506c [file] [log] [blame]
David Greaves2cf565c2005-05-10 22:32:30 +01001git-rev-list(1)
2===============
David Greaves2cf565c2005-05-10 22:32:30 +01003
4NAME
5----
6git-rev-list - Lists commit objects in reverse chronological order
7
8
9SYNOPSIS
10--------
Jonas Fonseca353ce812005-12-31 18:37:15 +010011[verse]
Štěpán Němec62b46982010-10-08 19:31:15 +020012'git rev-list' [ \--max-count=<number> ]
13 [ \--skip=<number> ]
14 [ \--max-age=<timestamp> ]
15 [ \--min-age=<timestamp> ]
Jonas Fonseca353ce812005-12-31 18:37:15 +010016 [ \--sparse ]
SZEDER Gábor26574202009-07-13 17:11:44 +020017 [ \--merges ]
Jonas Fonseca353ce812005-12-31 18:37:15 +010018 [ \--no-merges ]
Michael J Gruber6a6ebde2011-03-23 10:38:51 +010019 [ \--min-parents=<number> ]
20 [ \--no-min-parents ]
21 [ \--max-parents=<number> ]
22 [ \--no-max-parents ]
Junio C Hamano25db4652007-12-26 16:04:05 -080023 [ \--first-parent ]
Junio C Hamano93b74bc2006-01-27 01:39:24 -080024 [ \--remove-empty ]
Jakub Narebski29a6c3f2007-06-16 21:03:43 +020025 [ \--full-history ]
Rene Scharfe0d2c9d62006-07-02 01:29:37 +020026 [ \--not ]
Jonas Fonseca353ce812005-12-31 18:37:15 +010027 [ \--all ]
Štěpán Němec62b46982010-10-08 19:31:15 +020028 [ \--branches[=<pattern>] ]
29 [ \--tags[=<pattern>] ]
30 [ \--remotes[=<pattern>] ]
31 [ \--glob=<glob-pattern> ]
Junio C Hamanocc243c32011-05-18 18:08:09 -070032 [ \--ignore-missing ]
Junio C Hamano42cabc32006-09-05 21:39:02 -070033 [ \--stdin ]
Shawn O. Pearce27350892007-11-11 02:29:41 -050034 [ \--quiet ]
Linus Torvalds765ac8e2006-02-28 15:07:20 -080035 [ \--topo-order ]
Jonas Fonseca353ce812005-12-31 18:37:15 +010036 [ \--parents ]
Jakub Narebskie3c15002007-06-16 21:03:42 +020037 [ \--timestamp ]
Brian Gernhardtb24bace2007-04-05 10:53:07 -040038 [ \--left-right ]
Michael J Gruber59c8afd2011-02-21 17:09:12 +010039 [ \--left-only ]
40 [ \--right-only ]
Michael J Grubercb56e302011-03-07 13:31:41 +010041 [ \--cherry-mark ]
Junio C Hamano55a643e2007-04-10 15:28:32 -070042 [ \--cherry-pick ]
Jonathan Niedere6604c32013-08-02 15:16:40 -070043 [ \--encoding=<encoding> ]
Junio C Hamanobd95fcd2006-09-17 17:23:20 -070044 [ \--(author|committer|grep)=<pattern> ]
SZEDER Gábor5d6b3a92008-09-30 19:27:10 +020045 [ \--regexp-ignore-case | -i ]
46 [ \--extended-regexp | -E ]
47 [ \--fixed-strings | -F ]
Štěpán Němec0adda932010-10-08 19:31:17 +020048 [ \--date=(local|relative|default|iso|rfc|short) ]
Junio C Hamanoec579762006-03-02 01:11:31 -080049 [ [\--objects | \--objects-edge] [ \--unpacked ] ]
Jonas Fonseca353ce812005-12-31 18:37:15 +010050 [ \--pretty | \--header ]
51 [ \--bisect ]
Junio C Hamano457f08a2007-03-21 22:15:54 -070052 [ \--bisect-vars ]
Christian Couder3ac9f612007-10-22 07:48:11 +020053 [ \--bisect-all ]
Uwe Zeisbergerd249b452006-08-04 10:11:15 +020054 [ \--merge ]
Johannes Schindelin9c5e66e2007-01-20 23:04:02 +010055 [ \--reverse ]
Junio C Hamano4d12a472007-01-20 00:51:41 -080056 [ \--walk-reflogs ]
Johannes Schindelin8e640062007-07-24 00:38:40 +010057 [ \--no-walk ] [ \--do-walk ]
Vicent Martiaa329392013-12-21 09:00:12 -050058 [ \--use-bitmap-index ]
Jonas Fonseca353ce812005-12-31 18:37:15 +010059 <commit>... [ \-- <paths>... ]
David Greaves2cf565c2005-05-10 22:32:30 +010060
61DESCRIPTION
62-----------
Jonas Fonseca8c02eee2006-09-01 00:37:15 +020063
Junio C Hamano1a3d8342009-08-05 09:42:33 -070064List 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.
David Greaves2cf565c2005-05-10 22:32:30 +010068
Junio C Hamano1a3d8342009-08-05 09:42:33 -070069You 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:
Jonas Fonseca8c02eee2006-09-01 00:37:15 +020077
78-----------------------------------------------------------------------
Jonathan Niederb1889c32008-06-30 01:09:04 -050079 $ git rev-list foo bar ^baz
Jonas Fonseca8c02eee2006-09-01 00:37:15 +020080-----------------------------------------------------------------------
81
Junio C Hamano1a3d8342009-08-05 09:42:33 -070082means "list all the commits which are reachable from 'foo' or 'bar', but
83not from 'baz'".
Matthias Urlichsadcd3512005-07-29 20:10:46 +020084
Jonas Fonseca8c02eee2006-09-01 00:37:15 +020085A 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 Hamano69e0c252005-10-30 01:03:45 -080088
Jonas Fonseca8c02eee2006-09-01 00:37:15 +020089-----------------------------------------------------------------------
Jonathan Niederb1889c32008-06-30 01:09:04 -050090 $ git rev-list origin..HEAD
91 $ git rev-list HEAD ^origin
Jonas Fonseca8c02eee2006-09-01 00:37:15 +020092-----------------------------------------------------------------------
93
94Another special notation is "'<commit1>'...'<commit2>'" which is useful
95for merges. The resulting set of commits is the symmetric difference
Rene Scharfe0d2c9d62006-07-02 01:29:37 +020096between the two operands. The following two commands are equivalent:
97
Jonas Fonseca8c02eee2006-09-01 00:37:15 +020098-----------------------------------------------------------------------
Jonathan Niederb1889c32008-06-30 01:09:04 -050099 $ git rev-list A B --not $(git merge-base --all A B)
100 $ git rev-list A...B
Jonas Fonseca8c02eee2006-09-01 00:37:15 +0200101-----------------------------------------------------------------------
102
Thomas Ackermann2de9b712013-01-21 20:17:53 +0100103'rev-list' is a very essential Git command, since it
Jonas Fonseca8c02eee2006-09-01 00:37:15 +0200104provides the ability to build and traverse commit ancestry graphs. For
105this reason, it has a lot of different options that enables it to be
Thomas Rast0b444cd2010-01-10 00:33:00 +0100106used by commands as different as 'git bisect' and
107'git repack'.
Junio C Hamano69e0c252005-10-30 01:03:45 -0800108
Jonas Fonsecadf8baa42005-10-03 19:16:30 +0200109OPTIONS
110-------
Jonas Fonseca8c02eee2006-09-01 00:37:15 +0200111
Miklos Vajnafdcf39e2008-01-18 23:58:57 +0100112:git-rev-list: 1
113include::rev-list-options.txt[]
Jakub Narebski331b51d2007-05-14 01:25:45 +0200114
115include::pretty-formats.txt[]
116
David Greaves2cf565c2005-05-10 22:32:30 +0100117GIT
118---
Christian Couder9e1f0a82008-06-06 09:07:32 +0200119Part of the linkgit:git[1] suite