| 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 | 1dbca52 | 2015-05-22 20:48:55 | [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 ] |
| Junio C Hamano | 1eb5609 | 2015-10-05 20:39:53 | [diff] [blame] | 48 | [ --date=<format>] |
| Junio C Hamano | 1dbca52 | 2015-05-22 20:48:55 | [diff] [blame] | 49 | [ [ --objects | --objects-edge | --objects-edge-aggressive ] |
| 50 | [ --unpacked ] ] |
| 51 | [ --pretty | --header ] |
| 52 | [ --bisect ] |
| 53 | [ --bisect-vars ] |
| 54 | [ --bisect-all ] |
| 55 | [ --merge ] |
| 56 | [ --reverse ] |
| 57 | [ --walk-reflogs ] |
| 58 | [ --no-walk ] [ --do-walk ] |
| Junio C Hamano | 823eebb | 2015-07-10 22:29:34 | [diff] [blame] | 59 | [ --count ] |
| Junio C Hamano | 1dbca52 | 2015-05-22 20:48:55 | [diff] [blame] | 60 | [ --use-bitmap-index ] |
| Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 61 | <commit>... [ \-- <paths>... ] |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 62 | |
| 63 | DESCRIPTION |
| 64 | ----------- |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 65 | |
| Junio C Hamano | 31cca16 | 2009-08-07 05:40:01 | [diff] [blame] | 66 | List commits that are reachable by following the `parent` links from the |
| 67 | given commit(s), but exclude commits that are reachable from the one(s) |
| 68 | given with a '{caret}' in front of them. The output is given in reverse |
| 69 | chronological order by default. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 70 | |
| Junio C Hamano | 31cca16 | 2009-08-07 05:40:01 | [diff] [blame] | 71 | You can think of this as a set operation. Commits given on the command |
| 72 | line form a set of commits that are reachable from any of them, and then |
| 73 | commits reachable from any of the ones given with '{caret}' in front are |
| 74 | subtracted from that set. The remaining commits are what comes out in the |
| 75 | command's output. Various other options and paths parameters can be used |
| 76 | to further limit the result. |
| 77 | |
| 78 | Thus, the following command: |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 79 | |
| 80 | ----------------------------------------------------------------------- |
| Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 81 | $ git rev-list foo bar ^baz |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 82 | ----------------------------------------------------------------------- |
| 83 | |
| Junio C Hamano | 31cca16 | 2009-08-07 05:40:01 | [diff] [blame] | 84 | means "list all the commits which are reachable from 'foo' or 'bar', but |
| 85 | not from 'baz'". |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 86 | |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 87 | A special notation "'<commit1>'..'<commit2>'" can be used as a |
| 88 | short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of |
| 89 | the following may be used interchangeably: |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 90 | |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 91 | ----------------------------------------------------------------------- |
| Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 92 | $ git rev-list origin..HEAD |
| 93 | $ git rev-list HEAD ^origin |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 94 | ----------------------------------------------------------------------- |
| 95 | |
| 96 | Another special notation is "'<commit1>'...'<commit2>'" which is useful |
| 97 | for merges. The resulting set of commits is the symmetric difference |
| Junio C Hamano | 872c568 | 2006-07-07 06:05:40 | [diff] [blame] | 98 | between the two operands. The following two commands are equivalent: |
| 99 | |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 100 | ----------------------------------------------------------------------- |
| Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 101 | $ git rev-list A B --not $(git merge-base --all A B) |
| 102 | $ git rev-list A...B |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 103 | ----------------------------------------------------------------------- |
| 104 | |
| Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 105 | 'rev-list' is a very essential Git command, since it |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 106 | provides the ability to build and traverse commit ancestry graphs. For |
| 107 | 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] | 108 | used by commands as different as 'git bisect' and |
| 109 | 'git repack'. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 110 | |
| 111 | OPTIONS |
| 112 | ------- |
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 113 | |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 114 | :git-rev-list: 1 |
| 115 | include::rev-list-options.txt[] |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 116 | |
| 117 | include::pretty-formats.txt[] |
| 118 | |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 119 | GIT |
| 120 | --- |
| Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 121 | Part of the linkgit:git[1] suite |