| 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 | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 12 | 'git rev-list' [ \--max-count=<number> ] |
| 13 | [ \--skip=<number> ] |
| 14 | [ \--max-age=<timestamp> ] |
| 15 | [ \--min-age=<timestamp> ] |
| Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 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 | f32ce26 | 2011-03-27 07:35:11 | [diff] [blame] | 19 | [ \--min-parents=<number> ] |
| 20 | [ \--no-min-parents ] |
| 21 | [ \--max-parents=<number> ] |
| 22 | [ \--no-max-parents ] |
| Junio C Hamano | 554da79 | 2007-12-27 03:29:58 | [diff] [blame] | 23 | [ \--first-parent ] |
| Junio C Hamano | 9be1897 | 2006-01-28 08:54:57 | [diff] [blame] | 24 | [ \--remove-empty ] |
| Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 25 | [ \--full-history ] |
| Junio C Hamano | 872c568 | 2006-07-07 06:05:40 | [diff] [blame] | 26 | [ \--not ] |
| Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 27 | [ \--all ] |
| Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 28 | [ \--branches[=<pattern>] ] |
| 29 | [ \--tags[=<pattern>] ] |
| 30 | [ \--remotes[=<pattern>] ] |
| 31 | [ \--glob=<glob-pattern> ] |
| Junio C Hamano | 084228c | 2011-05-30 08:13:52 | [diff] [blame] | 32 | [ \--ignore-missing ] |
| Junio C Hamano | c9245d9 | 2006-09-06 09:35:46 | [diff] [blame] | 33 | [ \--stdin ] |
| Junio C Hamano | 8c5802d | 2007-11-15 00:13:36 | [diff] [blame] | 34 | [ \--quiet ] |
| Junio C Hamano | decf50e | 2006-03-05 10:51:14 | [diff] [blame] | 35 | [ \--topo-order ] |
| Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 36 | [ \--parents ] |
| Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 37 | [ \--timestamp ] |
| Junio C Hamano | 5678d69 | 2007-04-06 00:51:43 | [diff] [blame] | 38 | [ \--left-right ] |
| Junio C Hamano | 9a2fb2d | 2011-03-23 05:40:15 | [diff] [blame] | 39 | [ \--left-only ] |
| 40 | [ \--right-only ] |
| 41 | [ \--cherry-mark ] |
| Junio C Hamano | d9e0e5d | 2007-04-14 16:22:04 | [diff] [blame] | 42 | [ \--cherry-pick ] |
| Junio C Hamano | c5bb3b3 | 2013-08-05 22:43:36 | [diff] [blame] | 43 | [ \--encoding=<encoding> ] |
| Junio C Hamano | 47c1e3c | 2006-09-25 04:45:55 | [diff] [blame] | 44 | [ \--(author|committer|grep)=<pattern> ] |
| Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 45 | [ \--regexp-ignore-case | -i ] |
| 46 | [ \--extended-regexp | -E ] |
| 47 | [ \--fixed-strings | -F ] |
| Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 48 | [ \--date=(local|relative|default|iso|rfc|short) ] |
| Junio C Hamano | 5f32776 | 2006-03-02 09:14:51 | [diff] [blame] | 49 | [ [\--objects | \--objects-edge] [ \--unpacked ] ] |
| Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 50 | [ \--pretty | \--header ] |
| 51 | [ \--bisect ] |
| Junio C Hamano | 20f64da | 2007-04-04 18:38:30 | [diff] [blame] | 52 | [ \--bisect-vars ] |
| Junio C Hamano | 1974bf2 | 2007-10-31 05:57:20 | [diff] [blame] | 53 | [ \--bisect-all ] |
| Junio C Hamano | 859f3b4 | 2006-08-04 10:04:30 | [diff] [blame] | 54 | [ \--merge ] |
| Junio C Hamano | 053827f | 2007-02-14 07:23:58 | [diff] [blame] | 55 | [ \--reverse ] |
| Junio C Hamano | db450ba | 2007-01-21 08:57:14 | [diff] [blame] | 56 | [ \--walk-reflogs ] |
| Junio C Hamano | a196f6d | 2007-07-24 08:10:27 | [diff] [blame] | 57 | [ \--no-walk ] [ \--do-walk ] |
| Junio C Hamano | 5b3533d | 2014-02-27 23:07:15 | [diff] [blame] | 58 | [ \--use-bitmap-index ] |
| Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 59 | <commit>... [ \-- <paths>... ] |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 60 | |
| 61 | DESCRIPTION |
| 62 | ----------- |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 63 | |
| Junio C Hamano | 31cca16 | 2009-08-07 05:40:01 | [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. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 68 | |
| Junio C Hamano | 31cca16 | 2009-08-07 05:40:01 | [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: |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 77 | |
| 78 | ----------------------------------------------------------------------- |
| Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 79 | $ git rev-list foo bar ^baz |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 80 | ----------------------------------------------------------------------- |
| 81 | |
| Junio C Hamano | 31cca16 | 2009-08-07 05:40:01 | [diff] [blame] | 82 | means "list all the commits which are reachable from 'foo' or 'bar', but |
| 83 | not from 'baz'". |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 84 | |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [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 | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 88 | |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 89 | ----------------------------------------------------------------------- |
| Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 90 | $ git rev-list origin..HEAD |
| 91 | $ git rev-list HEAD ^origin |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [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 |
| Junio C Hamano | 872c568 | 2006-07-07 06:05:40 | [diff] [blame] | 96 | between the two operands. The following two commands are equivalent: |
| 97 | |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 98 | ----------------------------------------------------------------------- |
| Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 99 | $ git rev-list A B --not $(git merge-base --all A B) |
| 100 | $ git rev-list A...B |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 101 | ----------------------------------------------------------------------- |
| 102 | |
| Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 103 | 'rev-list' is a very essential Git command, since it |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [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 |
| Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 106 | used by commands as different as 'git bisect' and |
| 107 | 'git repack'. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 108 | |
| 109 | OPTIONS |
| 110 | ------- |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 111 | |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 112 | :git-rev-list: 1 |
| 113 | include::rev-list-options.txt[] |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 114 | |
| 115 | include::pretty-formats.txt[] |
| 116 | |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 117 | GIT |
| 118 | --- |
| Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 119 | Part of the linkgit:git[1] suite |