]>
Commit | Line | Data |
---|---|---|
2cf565c5 DG |
1 | git-rev-list(1) |
2 | =============== | |
2cf565c5 DG |
3 | |
4 | NAME | |
5 | ---- | |
6 | git-rev-list - Lists commit objects in reverse chronological order | |
7 | ||
8 | ||
9 | SYNOPSIS | |
10 | -------- | |
353ce815 | 11 | [verse] |
1c262bb7 JK |
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 ] | |
48 | [ --date=(local|relative|default|iso|iso-strict|rfc|short) ] | |
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 ] | |
59 | [ --use-bitmap-index ] | |
353ce815 | 60 | <commit>... [ \-- <paths>... ] |
2cf565c5 DG |
61 | |
62 | DESCRIPTION | |
63 | ----------- | |
8c02eee2 | 64 | |
1a3d834f JH |
65 | List commits that are reachable by following the `parent` links from the |
66 | given commit(s), but exclude commits that are reachable from the one(s) | |
67 | given with a '{caret}' in front of them. The output is given in reverse | |
68 | chronological order by default. | |
2cf565c5 | 69 | |
1a3d834f JH |
70 | You can think of this as a set operation. Commits given on the command |
71 | line form a set of commits that are reachable from any of them, and then | |
72 | commits reachable from any of the ones given with '{caret}' in front are | |
73 | subtracted from that set. The remaining commits are what comes out in the | |
74 | command's output. Various other options and paths parameters can be used | |
75 | to further limit the result. | |
76 | ||
77 | Thus, the following command: | |
8c02eee2 JF |
78 | |
79 | ----------------------------------------------------------------------- | |
b1889c36 | 80 | $ git rev-list foo bar ^baz |
8c02eee2 JF |
81 | ----------------------------------------------------------------------- |
82 | ||
1a3d834f JH |
83 | means "list all the commits which are reachable from 'foo' or 'bar', but |
84 | not from 'baz'". | |
adcd3512 | 85 | |
8c02eee2 JF |
86 | A special notation "'<commit1>'..'<commit2>'" can be used as a |
87 | short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of | |
88 | the following may be used interchangeably: | |
69e0c256 | 89 | |
8c02eee2 | 90 | ----------------------------------------------------------------------- |
b1889c36 JN |
91 | $ git rev-list origin..HEAD |
92 | $ git rev-list HEAD ^origin | |
8c02eee2 JF |
93 | ----------------------------------------------------------------------- |
94 | ||
95 | Another special notation is "'<commit1>'...'<commit2>'" which is useful | |
96 | for merges. The resulting set of commits is the symmetric difference | |
0d2c9d67 RS |
97 | between the two operands. The following two commands are equivalent: |
98 | ||
8c02eee2 | 99 | ----------------------------------------------------------------------- |
b1889c36 JN |
100 | $ git rev-list A B --not $(git merge-base --all A B) |
101 | $ git rev-list A...B | |
8c02eee2 JF |
102 | ----------------------------------------------------------------------- |
103 | ||
2de9b711 | 104 | 'rev-list' is a very essential Git command, since it |
8c02eee2 JF |
105 | provides the ability to build and traverse commit ancestry graphs. For |
106 | this reason, it has a lot of different options that enables it to be | |
0b444cdb TR |
107 | used by commands as different as 'git bisect' and |
108 | 'git repack'. | |
69e0c256 | 109 | |
df8baa42 JF |
110 | OPTIONS |
111 | ------- | |
8c02eee2 | 112 | |
fdcf39e5 MV |
113 | :git-rev-list: 1 |
114 | include::rev-list-options.txt[] | |
331b51d2 JN |
115 | |
116 | include::pretty-formats.txt[] | |
117 | ||
2cf565c5 DG |
118 | GIT |
119 | --- | |
9e1f0a85 | 120 | Part of the linkgit:git[1] suite |