]>
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] |
62b4698e ŠN |
12 | 'git rev-list' [ \--max-count=<number> ] |
13 | [ \--skip=<number> ] | |
14 | [ \--max-age=<timestamp> ] | |
15 | [ \--min-age=<timestamp> ] | |
353ce815 | 16 | [ \--sparse ] |
2657420d | 17 | [ \--merges ] |
353ce815 | 18 | [ \--no-merges ] |
6a6ebded MG |
19 | [ \--min-parents=<number> ] |
20 | [ \--no-min-parents ] | |
21 | [ \--max-parents=<number> ] | |
22 | [ \--no-max-parents ] | |
25db465a | 23 | [ \--first-parent ] |
93b74bca | 24 | [ \--remove-empty ] |
29a6c3f8 | 25 | [ \--full-history ] |
0d2c9d67 | 26 | [ \--not ] |
353ce815 | 27 | [ \--all ] |
62b4698e ŠN |
28 | [ \--branches[=<pattern>] ] |
29 | [ \--tags[=<pattern>] ] | |
30 | [ \--remotes[=<pattern>] ] | |
31 | [ \--glob=<glob-pattern> ] | |
42cabc34 | 32 | [ \--stdin ] |
27350891 | 33 | [ \--quiet ] |
765ac8ec | 34 | [ \--topo-order ] |
353ce815 | 35 | [ \--parents ] |
e3c1500f | 36 | [ \--timestamp ] |
b24bace5 | 37 | [ \--left-right ] |
59c8afdf MG |
38 | [ \--left-only ] |
39 | [ \--right-only ] | |
cb56e309 | 40 | [ \--cherry-mark ] |
55a643ed | 41 | [ \--cherry-pick ] |
7cbcf4d5 | 42 | [ \--encoding[=<encoding>] ] |
bd95fcd3 | 43 | [ \--(author|committer|grep)=<pattern> ] |
5d6b3a9e SG |
44 | [ \--regexp-ignore-case | -i ] |
45 | [ \--extended-regexp | -E ] | |
46 | [ \--fixed-strings | -F ] | |
0adda936 | 47 | [ \--date=(local|relative|default|iso|rfc|short) ] |
ec579767 | 48 | [ [\--objects | \--objects-edge] [ \--unpacked ] ] |
353ce815 JF |
49 | [ \--pretty | \--header ] |
50 | [ \--bisect ] | |
457f08a0 | 51 | [ \--bisect-vars ] |
3ac9f612 | 52 | [ \--bisect-all ] |
d249b455 | 53 | [ \--merge ] |
9c5e66e9 | 54 | [ \--reverse ] |
4d12a471 | 55 | [ \--walk-reflogs ] |
8e64006e | 56 | [ \--no-walk ] [ \--do-walk ] |
353ce815 | 57 | <commit>... [ \-- <paths>... ] |
2cf565c5 DG |
58 | |
59 | DESCRIPTION | |
60 | ----------- | |
8c02eee2 | 61 | |
1a3d834f JH |
62 | List commits that are reachable by following the `parent` links from the |
63 | given commit(s), but exclude commits that are reachable from the one(s) | |
64 | given with a '{caret}' in front of them. The output is given in reverse | |
65 | chronological order by default. | |
2cf565c5 | 66 | |
1a3d834f JH |
67 | You can think of this as a set operation. Commits given on the command |
68 | line form a set of commits that are reachable from any of them, and then | |
69 | commits reachable from any of the ones given with '{caret}' in front are | |
70 | subtracted from that set. The remaining commits are what comes out in the | |
71 | command's output. Various other options and paths parameters can be used | |
72 | to further limit the result. | |
73 | ||
74 | Thus, the following command: | |
8c02eee2 JF |
75 | |
76 | ----------------------------------------------------------------------- | |
b1889c36 | 77 | $ git rev-list foo bar ^baz |
8c02eee2 JF |
78 | ----------------------------------------------------------------------- |
79 | ||
1a3d834f JH |
80 | means "list all the commits which are reachable from 'foo' or 'bar', but |
81 | not from 'baz'". | |
adcd3512 | 82 | |
8c02eee2 JF |
83 | A special notation "'<commit1>'..'<commit2>'" can be used as a |
84 | short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of | |
85 | the following may be used interchangeably: | |
69e0c256 | 86 | |
8c02eee2 | 87 | ----------------------------------------------------------------------- |
b1889c36 JN |
88 | $ git rev-list origin..HEAD |
89 | $ git rev-list HEAD ^origin | |
8c02eee2 JF |
90 | ----------------------------------------------------------------------- |
91 | ||
92 | Another special notation is "'<commit1>'...'<commit2>'" which is useful | |
93 | for merges. The resulting set of commits is the symmetric difference | |
0d2c9d67 RS |
94 | between the two operands. The following two commands are equivalent: |
95 | ||
8c02eee2 | 96 | ----------------------------------------------------------------------- |
b1889c36 JN |
97 | $ git rev-list A B --not $(git merge-base --all A B) |
98 | $ git rev-list A...B | |
8c02eee2 JF |
99 | ----------------------------------------------------------------------- |
100 | ||
57f6ec02 | 101 | 'rev-list' is a very essential git command, since it |
8c02eee2 JF |
102 | provides the ability to build and traverse commit ancestry graphs. For |
103 | this reason, it has a lot of different options that enables it to be | |
0b444cdb TR |
104 | used by commands as different as 'git bisect' and |
105 | 'git repack'. | |
69e0c256 | 106 | |
df8baa42 JF |
107 | OPTIONS |
108 | ------- | |
8c02eee2 | 109 | |
fdcf39e5 MV |
110 | :git-rev-list: 1 |
111 | include::rev-list-options.txt[] | |
331b51d2 JN |
112 | |
113 | include::pretty-formats.txt[] | |
114 | ||
2cf565c5 DG |
115 | GIT |
116 | --- | |
9e1f0a85 | 117 | Part of the linkgit:git[1] suite |