6 git-rev-list - Lists commit objects in reverse chronological order
12 'git rev-list' [<options>] <commit>... [[--] <path>...]
17 List commits that are reachable by following the `parent` links from the
18 given commit(s), but exclude commits that are reachable from the one(s)
19 given with a '{caret}' in front of them. The output is given in reverse
20 chronological order by default.
22 You can think of this as a set operation. Commits given on the command
23 line form a set of commits that are reachable from any of them, and then
24 commits reachable from any of the ones given with '{caret}' in front are
25 subtracted from that set. The remaining commits are what comes out in the
26 command's output. Various other options and paths parameters can be used
27 to further limit the result.
29 Thus, the following command:
31 -----------------------------------------------------------------------
32 $ git rev-list foo bar ^baz
33 -----------------------------------------------------------------------
35 means "list all the commits which are reachable from 'foo' or 'bar', but
38 A special notation "'<commit1>'..'<commit2>'" can be used as a
39 short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of
40 the following may be used interchangeably:
42 -----------------------------------------------------------------------
43 $ git rev-list origin..HEAD
44 $ git rev-list HEAD ^origin
45 -----------------------------------------------------------------------
47 Another special notation is "'<commit1>'...'<commit2>'" which is useful
48 for merges. The resulting set of commits is the symmetric difference
49 between the two operands. The following two commands are equivalent:
51 -----------------------------------------------------------------------
52 $ git rev-list A B --not $(git merge-base --all A B)
54 -----------------------------------------------------------------------
56 'rev-list' is a very essential Git command, since it
57 provides the ability to build and traverse commit ancestry graphs. For
58 this reason, it has a lot of different options that enables it to be
59 used by commands as different as 'git bisect' and
66 include::rev-list-options.txt[]
68 include::pretty-formats.txt[]
72 Part of the linkgit:git[1] suite