David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 1 | git-rev-list(1) |
| 2 | =============== |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 3 | |
| 4 | NAME |
| 5 | ---- |
| 6 | git-rev-list - Lists commit objects in reverse chronological order |
| 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
Jonas Fonseca | 353ce81 | 2005-12-31 18:37:15 +0100 | [diff] [blame] | 11 | [verse] |
Štěpán Němec | 62b4698 | 2010-10-08 19:31:15 +0200 | [diff] [blame] | 12 | 'git rev-list' [ \--max-count=<number> ] |
| 13 | [ \--skip=<number> ] |
| 14 | [ \--max-age=<timestamp> ] |
| 15 | [ \--min-age=<timestamp> ] |
Jonas Fonseca | 353ce81 | 2005-12-31 18:37:15 +0100 | [diff] [blame] | 16 | [ \--sparse ] |
SZEDER Gábor | 2657420 | 2009-07-13 17:11:44 +0200 | [diff] [blame] | 17 | [ \--merges ] |
Jonas Fonseca | 353ce81 | 2005-12-31 18:37:15 +0100 | [diff] [blame] | 18 | [ \--no-merges ] |
Michael J Gruber | 6a6ebde | 2011-03-23 10:38:51 +0100 | [diff] [blame] | 19 | [ \--min-parents=<number> ] |
| 20 | [ \--no-min-parents ] |
| 21 | [ \--max-parents=<number> ] |
| 22 | [ \--no-max-parents ] |
Junio C Hamano | 25db465 | 2007-12-26 16:04:05 -0800 | [diff] [blame] | 23 | [ \--first-parent ] |
Junio C Hamano | 93b74bc | 2006-01-27 01:39:24 -0800 | [diff] [blame] | 24 | [ \--remove-empty ] |
Jakub Narebski | 29a6c3f | 2007-06-16 21:03:43 +0200 | [diff] [blame] | 25 | [ \--full-history ] |
Rene Scharfe | 0d2c9d6 | 2006-07-02 01:29:37 +0200 | [diff] [blame] | 26 | [ \--not ] |
Jonas Fonseca | 353ce81 | 2005-12-31 18:37:15 +0100 | [diff] [blame] | 27 | [ \--all ] |
Štěpán Němec | 62b4698 | 2010-10-08 19:31:15 +0200 | [diff] [blame] | 28 | [ \--branches[=<pattern>] ] |
| 29 | [ \--tags[=<pattern>] ] |
| 30 | [ \--remotes[=<pattern>] ] |
| 31 | [ \--glob=<glob-pattern> ] |
Junio C Hamano | cc243c3 | 2011-05-18 18:08:09 -0700 | [diff] [blame] | 32 | [ \--ignore-missing ] |
Junio C Hamano | 42cabc3 | 2006-09-05 21:39:02 -0700 | [diff] [blame] | 33 | [ \--stdin ] |
Shawn O. Pearce | 2735089 | 2007-11-11 02:29:41 -0500 | [diff] [blame] | 34 | [ \--quiet ] |
Linus Torvalds | 765ac8e | 2006-02-28 15:07:20 -0800 | [diff] [blame] | 35 | [ \--topo-order ] |
Jonas Fonseca | 353ce81 | 2005-12-31 18:37:15 +0100 | [diff] [blame] | 36 | [ \--parents ] |
Jakub Narebski | e3c1500 | 2007-06-16 21:03:42 +0200 | [diff] [blame] | 37 | [ \--timestamp ] |
Brian Gernhardt | b24bace | 2007-04-05 10:53:07 -0400 | [diff] [blame] | 38 | [ \--left-right ] |
Michael J Gruber | 59c8afd | 2011-02-21 17:09:12 +0100 | [diff] [blame] | 39 | [ \--left-only ] |
| 40 | [ \--right-only ] |
Michael J Gruber | cb56e30 | 2011-03-07 13:31:41 +0100 | [diff] [blame] | 41 | [ \--cherry-mark ] |
Junio C Hamano | 55a643e | 2007-04-10 15:28:32 -0700 | [diff] [blame] | 42 | [ \--cherry-pick ] |
Jonathan Nieder | e6604c3 | 2013-08-02 15:16:40 -0700 | [diff] [blame] | 43 | [ \--encoding=<encoding> ] |
Junio C Hamano | bd95fcd | 2006-09-17 17:23:20 -0700 | [diff] [blame] | 44 | [ \--(author|committer|grep)=<pattern> ] |
SZEDER Gábor | 5d6b3a9 | 2008-09-30 19:27:10 +0200 | [diff] [blame] | 45 | [ \--regexp-ignore-case | -i ] |
| 46 | [ \--extended-regexp | -E ] |
| 47 | [ \--fixed-strings | -F ] |
Štěpán Němec | 0adda93 | 2010-10-08 19:31:17 +0200 | [diff] [blame] | 48 | [ \--date=(local|relative|default|iso|rfc|short) ] |
Junio C Hamano | ec57976 | 2006-03-02 01:11:31 -0800 | [diff] [blame] | 49 | [ [\--objects | \--objects-edge] [ \--unpacked ] ] |
Jonas Fonseca | 353ce81 | 2005-12-31 18:37:15 +0100 | [diff] [blame] | 50 | [ \--pretty | \--header ] |
| 51 | [ \--bisect ] |
Junio C Hamano | 457f08a | 2007-03-21 22:15:54 -0700 | [diff] [blame] | 52 | [ \--bisect-vars ] |
Christian Couder | 3ac9f61 | 2007-10-22 07:48:11 +0200 | [diff] [blame] | 53 | [ \--bisect-all ] |
Uwe Zeisberger | d249b45 | 2006-08-04 10:11:15 +0200 | [diff] [blame] | 54 | [ \--merge ] |
Johannes Schindelin | 9c5e66e | 2007-01-20 23:04:02 +0100 | [diff] [blame] | 55 | [ \--reverse ] |
Junio C Hamano | 4d12a47 | 2007-01-20 00:51:41 -0800 | [diff] [blame] | 56 | [ \--walk-reflogs ] |
Johannes Schindelin | 8e64006 | 2007-07-24 00:38:40 +0100 | [diff] [blame] | 57 | [ \--no-walk ] [ \--do-walk ] |
Vicent Marti | aa32939 | 2013-12-21 09:00:12 -0500 | [diff] [blame] | 58 | [ \--use-bitmap-index ] |
Jonas Fonseca | 353ce81 | 2005-12-31 18:37:15 +0100 | [diff] [blame] | 59 | <commit>... [ \-- <paths>... ] |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 60 | |
| 61 | DESCRIPTION |
| 62 | ----------- |
Jonas Fonseca | 8c02eee | 2006-09-01 00:37:15 +0200 | [diff] [blame] | 63 | |
Junio C Hamano | 1a3d834 | 2009-08-05 09:42:33 -0700 | [diff] [blame] | 64 | List commits that are reachable by following the `parent` links from the |
| 65 | given commit(s), but exclude commits that are reachable from the one(s) |
| 66 | given with a '{caret}' in front of them. The output is given in reverse |
| 67 | chronological order by default. |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 68 | |
Junio C Hamano | 1a3d834 | 2009-08-05 09:42:33 -0700 | [diff] [blame] | 69 | You can think of this as a set operation. Commits given on the command |
| 70 | line form a set of commits that are reachable from any of them, and then |
| 71 | commits reachable from any of the ones given with '{caret}' in front are |
| 72 | subtracted from that set. The remaining commits are what comes out in the |
| 73 | command's output. Various other options and paths parameters can be used |
| 74 | to further limit the result. |
| 75 | |
| 76 | Thus, the following command: |
Jonas Fonseca | 8c02eee | 2006-09-01 00:37:15 +0200 | [diff] [blame] | 77 | |
| 78 | ----------------------------------------------------------------------- |
Jonathan Nieder | b1889c3 | 2008-06-30 01:09:04 -0500 | [diff] [blame] | 79 | $ git rev-list foo bar ^baz |
Jonas Fonseca | 8c02eee | 2006-09-01 00:37:15 +0200 | [diff] [blame] | 80 | ----------------------------------------------------------------------- |
| 81 | |
Junio C Hamano | 1a3d834 | 2009-08-05 09:42:33 -0700 | [diff] [blame] | 82 | means "list all the commits which are reachable from 'foo' or 'bar', but |
| 83 | not from 'baz'". |
Matthias Urlichs | adcd351 | 2005-07-29 20:10:46 +0200 | [diff] [blame] | 84 | |
Jonas Fonseca | 8c02eee | 2006-09-01 00:37:15 +0200 | [diff] [blame] | 85 | A special notation "'<commit1>'..'<commit2>'" can be used as a |
| 86 | short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of |
| 87 | the following may be used interchangeably: |
Junio C Hamano | 69e0c25 | 2005-10-30 01:03:45 -0800 | [diff] [blame] | 88 | |
Jonas Fonseca | 8c02eee | 2006-09-01 00:37:15 +0200 | [diff] [blame] | 89 | ----------------------------------------------------------------------- |
Jonathan Nieder | b1889c3 | 2008-06-30 01:09:04 -0500 | [diff] [blame] | 90 | $ git rev-list origin..HEAD |
| 91 | $ git rev-list HEAD ^origin |
Jonas Fonseca | 8c02eee | 2006-09-01 00:37:15 +0200 | [diff] [blame] | 92 | ----------------------------------------------------------------------- |
| 93 | |
| 94 | Another special notation is "'<commit1>'...'<commit2>'" which is useful |
| 95 | for merges. The resulting set of commits is the symmetric difference |
Rene Scharfe | 0d2c9d6 | 2006-07-02 01:29:37 +0200 | [diff] [blame] | 96 | between the two operands. The following two commands are equivalent: |
| 97 | |
Jonas Fonseca | 8c02eee | 2006-09-01 00:37:15 +0200 | [diff] [blame] | 98 | ----------------------------------------------------------------------- |
Jonathan Nieder | b1889c3 | 2008-06-30 01:09:04 -0500 | [diff] [blame] | 99 | $ git rev-list A B --not $(git merge-base --all A B) |
| 100 | $ git rev-list A...B |
Jonas Fonseca | 8c02eee | 2006-09-01 00:37:15 +0200 | [diff] [blame] | 101 | ----------------------------------------------------------------------- |
| 102 | |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 103 | 'rev-list' is a very essential Git command, since it |
Jonas Fonseca | 8c02eee | 2006-09-01 00:37:15 +0200 | [diff] [blame] | 104 | provides the ability to build and traverse commit ancestry graphs. For |
| 105 | this reason, it has a lot of different options that enables it to be |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 106 | used by commands as different as 'git bisect' and |
| 107 | 'git repack'. |
Junio C Hamano | 69e0c25 | 2005-10-30 01:03:45 -0800 | [diff] [blame] | 108 | |
Jonas Fonseca | df8baa4 | 2005-10-03 19:16:30 +0200 | [diff] [blame] | 109 | OPTIONS |
| 110 | ------- |
Jonas Fonseca | 8c02eee | 2006-09-01 00:37:15 +0200 | [diff] [blame] | 111 | |
Miklos Vajna | fdcf39e | 2008-01-18 23:58:57 +0100 | [diff] [blame] | 112 | :git-rev-list: 1 |
| 113 | include::rev-list-options.txt[] |
Jakub Narebski | 331b51d | 2007-05-14 01:25:45 +0200 | [diff] [blame] | 114 | |
| 115 | include::pretty-formats.txt[] |
| 116 | |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 117 | GIT |
| 118 | --- |
Christian Couder | 9e1f0a8 | 2008-06-06 09:07:32 +0200 | [diff] [blame] | 119 | Part of the linkgit:git[1] suite |