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] |
Jeff King | 1c262bb | 2015-05-13 01:01:38 -0400 | [diff] [blame] | 12 | '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 ] |
John Keeping | 4b1c5e1 | 2015-09-03 22:48:54 +0100 | [diff] [blame] | 48 | [ --date=<format>] |
Jeff King | 1c262bb | 2015-05-13 01:01:38 -0400 | [diff] [blame] | 49 | [ [ --objects | --objects-edge | --objects-edge-aggressive ] |
Jeff Hostetler | caf3827 | 2017-11-21 20:58:51 +0000 | [diff] [blame] | 50 | [ --unpacked ] |
| 51 | [ --filter=<filter-spec> [ --filter-print-omitted ] ] ] |
| 52 | [ --missing=<missing-action> ] |
Jeff King | 1c262bb | 2015-05-13 01:01:38 -0400 | [diff] [blame] | 53 | [ --pretty | --header ] |
| 54 | [ --bisect ] |
| 55 | [ --bisect-vars ] |
| 56 | [ --bisect-all ] |
| 57 | [ --merge ] |
| 58 | [ --reverse ] |
| 59 | [ --walk-reflogs ] |
| 60 | [ --no-walk ] [ --do-walk ] |
Lawrence Siebert | 75d2e5a | 2015-07-01 02:24:11 -0700 | [diff] [blame] | 61 | [ --count ] |
Jeff King | 1c262bb | 2015-05-13 01:01:38 -0400 | [diff] [blame] | 62 | [ --use-bitmap-index ] |
Jonas Fonseca | 353ce81 | 2005-12-31 18:37:15 +0100 | [diff] [blame] | 63 | <commit>... [ \-- <paths>... ] |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 64 | |
| 65 | DESCRIPTION |
| 66 | ----------- |
Jonas Fonseca | 8c02eee | 2006-09-01 00:37:15 +0200 | [diff] [blame] | 67 | |
Junio C Hamano | 1a3d834 | 2009-08-05 09:42:33 -0700 | [diff] [blame] | 68 | List commits that are reachable by following the `parent` links from the |
| 69 | given commit(s), but exclude commits that are reachable from the one(s) |
| 70 | given with a '{caret}' in front of them. The output is given in reverse |
| 71 | chronological order by default. |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 72 | |
Junio C Hamano | 1a3d834 | 2009-08-05 09:42:33 -0700 | [diff] [blame] | 73 | You can think of this as a set operation. Commits given on the command |
| 74 | line form a set of commits that are reachable from any of them, and then |
| 75 | commits reachable from any of the ones given with '{caret}' in front are |
| 76 | subtracted from that set. The remaining commits are what comes out in the |
| 77 | command's output. Various other options and paths parameters can be used |
| 78 | to further limit the result. |
| 79 | |
| 80 | Thus, the following command: |
Jonas Fonseca | 8c02eee | 2006-09-01 00:37:15 +0200 | [diff] [blame] | 81 | |
| 82 | ----------------------------------------------------------------------- |
Jonathan Nieder | b1889c3 | 2008-06-30 01:09:04 -0500 | [diff] [blame] | 83 | $ git rev-list foo bar ^baz |
Jonas Fonseca | 8c02eee | 2006-09-01 00:37:15 +0200 | [diff] [blame] | 84 | ----------------------------------------------------------------------- |
| 85 | |
Junio C Hamano | 1a3d834 | 2009-08-05 09:42:33 -0700 | [diff] [blame] | 86 | means "list all the commits which are reachable from 'foo' or 'bar', but |
| 87 | not from 'baz'". |
Matthias Urlichs | adcd351 | 2005-07-29 20:10:46 +0200 | [diff] [blame] | 88 | |
Jonas Fonseca | 8c02eee | 2006-09-01 00:37:15 +0200 | [diff] [blame] | 89 | A special notation "'<commit1>'..'<commit2>'" can be used as a |
| 90 | short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of |
| 91 | the following may be used interchangeably: |
Junio C Hamano | 69e0c25 | 2005-10-30 01:03:45 -0800 | [diff] [blame] | 92 | |
Jonas Fonseca | 8c02eee | 2006-09-01 00:37:15 +0200 | [diff] [blame] | 93 | ----------------------------------------------------------------------- |
Jonathan Nieder | b1889c3 | 2008-06-30 01:09:04 -0500 | [diff] [blame] | 94 | $ git rev-list origin..HEAD |
| 95 | $ git rev-list HEAD ^origin |
Jonas Fonseca | 8c02eee | 2006-09-01 00:37:15 +0200 | [diff] [blame] | 96 | ----------------------------------------------------------------------- |
| 97 | |
| 98 | Another special notation is "'<commit1>'...'<commit2>'" which is useful |
| 99 | for merges. The resulting set of commits is the symmetric difference |
Rene Scharfe | 0d2c9d6 | 2006-07-02 01:29:37 +0200 | [diff] [blame] | 100 | between the two operands. The following two commands are equivalent: |
| 101 | |
Jonas Fonseca | 8c02eee | 2006-09-01 00:37:15 +0200 | [diff] [blame] | 102 | ----------------------------------------------------------------------- |
Jonathan Nieder | b1889c3 | 2008-06-30 01:09:04 -0500 | [diff] [blame] | 103 | $ git rev-list A B --not $(git merge-base --all A B) |
| 104 | $ git rev-list A...B |
Jonas Fonseca | 8c02eee | 2006-09-01 00:37:15 +0200 | [diff] [blame] | 105 | ----------------------------------------------------------------------- |
| 106 | |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 107 | 'rev-list' is a very essential Git command, since it |
Jonas Fonseca | 8c02eee | 2006-09-01 00:37:15 +0200 | [diff] [blame] | 108 | provides the ability to build and traverse commit ancestry graphs. For |
| 109 | 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] | 110 | used by commands as different as 'git bisect' and |
| 111 | 'git repack'. |
Junio C Hamano | 69e0c25 | 2005-10-30 01:03:45 -0800 | [diff] [blame] | 112 | |
Jonas Fonseca | df8baa4 | 2005-10-03 19:16:30 +0200 | [diff] [blame] | 113 | OPTIONS |
| 114 | ------- |
Jonas Fonseca | 8c02eee | 2006-09-01 00:37:15 +0200 | [diff] [blame] | 115 | |
Miklos Vajna | fdcf39e | 2008-01-18 23:58:57 +0100 | [diff] [blame] | 116 | :git-rev-list: 1 |
| 117 | include::rev-list-options.txt[] |
Jakub Narebski | 331b51d | 2007-05-14 01:25:45 +0200 | [diff] [blame] | 118 | |
| 119 | include::pretty-formats.txt[] |
| 120 | |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 121 | GIT |
| 122 | --- |
Christian Couder | 9e1f0a8 | 2008-06-06 09:07:32 +0200 | [diff] [blame] | 123 | Part of the linkgit:git[1] suite |