| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | git-rev-list(1) |
| 2 | =============== |
| 3 | |
| 4 | NAME |
| 5 | ---- |
| 6 | git-rev-list - Lists commit objects in reverse chronological order |
| 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
| Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 11 | [verse] |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 12 | 'git-rev-list' [ \--max-count=number ] |
| Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 13 | [ \--skip=number ] |
| Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 14 | [ \--max-age=timestamp ] |
| 15 | [ \--min-age=timestamp ] |
| 16 | [ \--sparse ] |
| Junio C Hamano | 934e178 | 2009-07-16 06:59:15 | [diff] [blame] | 17 | [ \--merges ] |
| Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 18 | [ \--no-merges ] |
| Junio C Hamano | 554da79 | 2007-12-27 03:29:58 | [diff] [blame] | 19 | [ \--first-parent ] |
| Junio C Hamano | 9be1897 | 2006-01-28 08:54:57 | [diff] [blame] | 20 | [ \--remove-empty ] |
| Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 21 | [ \--full-history ] |
| Junio C Hamano | 872c568 | 2006-07-07 06:05:40 | [diff] [blame] | 22 | [ \--not ] |
| Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 23 | [ \--all ] |
| Junio C Hamano | 40f54d3 | 2008-02-29 09:21:50 | [diff] [blame] | 24 | [ \--branches ] |
| 25 | [ \--tags ] |
| 26 | [ \--remotes ] |
| Junio C Hamano | c9245d9 | 2006-09-06 09:35:46 | [diff] [blame] | 27 | [ \--stdin ] |
| Junio C Hamano | 8c5802d | 2007-11-15 00:13:36 | [diff] [blame] | 28 | [ \--quiet ] |
| Junio C Hamano | decf50e | 2006-03-05 10:51:14 | [diff] [blame] | 29 | [ \--topo-order ] |
| Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 30 | [ \--parents ] |
| Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 31 | [ \--timestamp ] |
| Junio C Hamano | 5678d69 | 2007-04-06 00:51:43 | [diff] [blame] | 32 | [ \--left-right ] |
| Junio C Hamano | d9e0e5d | 2007-04-14 16:22:04 | [diff] [blame] | 33 | [ \--cherry-pick ] |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 34 | [ \--encoding[=<encoding>] ] |
| Junio C Hamano | 47c1e3c | 2006-09-25 04:45:55 | [diff] [blame] | 35 | [ \--(author|committer|grep)=<pattern> ] |
| Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 36 | [ \--regexp-ignore-case | -i ] |
| 37 | [ \--extended-regexp | -E ] |
| 38 | [ \--fixed-strings | -F ] |
| Junio C Hamano | 02f130b | 2007-07-14 08:26:56 | [diff] [blame] | 39 | [ \--date={local|relative|default|iso|rfc|short} ] |
| Junio C Hamano | 5f32776 | 2006-03-02 09:14:51 | [diff] [blame] | 40 | [ [\--objects | \--objects-edge] [ \--unpacked ] ] |
| Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 41 | [ \--pretty | \--header ] |
| 42 | [ \--bisect ] |
| Junio C Hamano | 20f64da | 2007-04-04 18:38:30 | [diff] [blame] | 43 | [ \--bisect-vars ] |
| Junio C Hamano | 1974bf2 | 2007-10-31 05:57:20 | [diff] [blame] | 44 | [ \--bisect-all ] |
| Junio C Hamano | 859f3b4 | 2006-08-04 10:04:30 | [diff] [blame] | 45 | [ \--merge ] |
| Junio C Hamano | 053827f | 2007-02-14 07:23:58 | [diff] [blame] | 46 | [ \--reverse ] |
| Junio C Hamano | db450ba | 2007-01-21 08:57:14 | [diff] [blame] | 47 | [ \--walk-reflogs ] |
| Junio C Hamano | a196f6d | 2007-07-24 08:10:27 | [diff] [blame] | 48 | [ \--no-walk ] [ \--do-walk ] |
| Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 49 | <commit>... [ \-- <paths>... ] |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 50 | |
| 51 | DESCRIPTION |
| 52 | ----------- |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 53 | |
| Junio C Hamano | 31cca16 | 2009-08-07 05:40:01 | [diff] [blame] | 54 | List commits that are reachable by following the `parent` links from the |
| 55 | given commit(s), but exclude commits that are reachable from the one(s) |
| 56 | given with a '{caret}' in front of them. The output is given in reverse |
| 57 | chronological order by default. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 58 | |
| Junio C Hamano | 31cca16 | 2009-08-07 05:40:01 | [diff] [blame] | 59 | You can think of this as a set operation. Commits given on the command |
| 60 | line form a set of commits that are reachable from any of them, and then |
| 61 | commits reachable from any of the ones given with '{caret}' in front are |
| 62 | subtracted from that set. The remaining commits are what comes out in the |
| 63 | command's output. Various other options and paths parameters can be used |
| 64 | to further limit the result. |
| 65 | |
| 66 | Thus, the following command: |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 67 | |
| 68 | ----------------------------------------------------------------------- |
| Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 69 | $ git rev-list foo bar ^baz |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 70 | ----------------------------------------------------------------------- |
| 71 | |
| Junio C Hamano | 31cca16 | 2009-08-07 05:40:01 | [diff] [blame] | 72 | means "list all the commits which are reachable from 'foo' or 'bar', but |
| 73 | not from 'baz'". |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 74 | |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 75 | A special notation "'<commit1>'..'<commit2>'" can be used as a |
| 76 | short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of |
| 77 | the following may be used interchangeably: |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 78 | |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 79 | ----------------------------------------------------------------------- |
| Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 80 | $ git rev-list origin..HEAD |
| 81 | $ git rev-list HEAD ^origin |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 82 | ----------------------------------------------------------------------- |
| 83 | |
| 84 | Another special notation is "'<commit1>'...'<commit2>'" which is useful |
| 85 | for merges. The resulting set of commits is the symmetric difference |
| Junio C Hamano | 872c568 | 2006-07-07 06:05:40 | [diff] [blame] | 86 | between the two operands. The following two commands are equivalent: |
| 87 | |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 88 | ----------------------------------------------------------------------- |
| Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 89 | $ git rev-list A B --not $(git merge-base --all A B) |
| 90 | $ git rev-list A...B |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 91 | ----------------------------------------------------------------------- |
| 92 | |
| Junio C Hamano | 27a128b | 2009-08-13 01:23:00 | [diff] [blame^] | 93 | 'rev-list' is a very essential git command, since it |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 94 | provides the ability to build and traverse commit ancestry graphs. For |
| 95 | this reason, it has a lot of different options that enables it to be |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 96 | used by commands as different as 'git-bisect' and |
| 97 | 'git-repack'. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 98 | |
| 99 | OPTIONS |
| 100 | ------- |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 101 | |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 102 | :git-rev-list: 1 |
| 103 | include::rev-list-options.txt[] |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 104 | |
| 105 | include::pretty-formats.txt[] |
| 106 | |
| 107 | |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 108 | Author |
| 109 | ------ |
| 110 | Written by Linus Torvalds <torvalds@osdl.org> |
| 111 | |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 112 | Documentation |
| 113 | -------------- |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 114 | Documentation by David Greaves, Junio C Hamano, Jonas Fonseca |
| 115 | and the git-list <git@vger.kernel.org>. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 116 | |
| 117 | GIT |
| 118 | --- |
| Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 119 | Part of the linkgit:git[1] suite |