]> git.ipfire.org Git - thirdparty/git.git/blob - Documentation/git-rev-list.txt
Merge branch 'bw/format-patch-o-create-leading-dirs'
[thirdparty/git.git] / Documentation / git-rev-list.txt
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 --------
11 [verse]
12 'git rev-list' [<options>] <commit>... [[--] <path>...]
13
14 DESCRIPTION
15 -----------
16
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.
21
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.
28
29 Thus, the following command:
30
31 -----------------------------------------------------------------------
32 $ git rev-list foo bar ^baz
33 -----------------------------------------------------------------------
34
35 means "list all the commits which are reachable from 'foo' or 'bar', but
36 not from 'baz'".
37
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:
41
42 -----------------------------------------------------------------------
43 $ git rev-list origin..HEAD
44 $ git rev-list HEAD ^origin
45 -----------------------------------------------------------------------
46
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:
50
51 -----------------------------------------------------------------------
52 $ git rev-list A B --not $(git merge-base --all A B)
53 $ git rev-list A...B
54 -----------------------------------------------------------------------
55
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
60 'git repack'.
61
62 OPTIONS
63 -------
64
65 :git-rev-list: 1
66 include::rev-list-options.txt[]
67
68 include::pretty-formats.txt[]
69
70 GIT
71 ---
72 Part of the linkgit:git[1] suite