6 git-diff-tree - Compares the content and mode of blobs found via two tree objects
12 'git diff-tree' [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty]
13 [-t] [-r] [-c | --cc] [--root] [<common diff options>]
14 <tree-ish> [<tree-ish>] [<path>...]
18 Compares the content and mode of the blobs found via two tree objects.
20 If there is only one <tree-ish> given, the commit is compared with its parents
23 Note that 'git diff-tree' can use the tree encapsulated in a commit object.
27 include::diff-options.txt[]
30 The id of a tree object.
33 If provided, the results are limited to a subset of files
34 matching one of the provided pathspecs.
37 recurse into sub-trees
40 show tree entry itself as well as subtrees. Implies -r.
43 When `--root` is specified the initial commit will be shown as a big
44 creation event. This is equivalent to a diff against the NULL tree.
47 When `--stdin` is specified, the command does not take
48 <tree-ish> arguments from the command line. Instead, it
49 reads lines containing either two <tree>, one <commit>, or a
50 list of <commit> from its standard input. (Use a single space
53 When two trees are given, it compares the first tree with the second.
54 When a single commit is given, it compares the commit with its
55 parents. The remaining commits, when given, are used as if they are
56 parents of the first commit.
58 When comparing two trees, the ID of both trees (separated by a space
59 and terminated by a newline) is printed before the difference. When
60 comparing commits, the ID of the first (or only) commit, followed by a
63 The following flags further affect the behavior when comparing
64 commits (but not trees).
67 By default, 'git diff-tree --stdin' does not show
68 differences for merge commits. With this flag, it shows
69 differences to that commit from all of its parents. See
73 By default, 'git diff-tree --stdin' shows differences,
74 either in machine-readable form (without `-p`) or in patch
75 form (with `-p`). This output can be suppressed. It is
76 only useful with `-v` flag.
79 This flag causes 'git diff-tree --stdin' to also show
80 the commit message before the differences.
82 include::pretty-options.txt[]
85 'git diff-tree' outputs a line with the commit ID when
86 applicable. This flag suppressed the commit ID output.
89 This flag changes the way a merge commit is displayed
90 (which means it is useful only when the command is given
91 one <tree-ish>, or `--stdin`). It shows the differences
92 from each of the parents to the merge result simultaneously
93 instead of showing pairwise diff between a parent and the
94 result one at a time (which is what the `-m` option does).
95 Furthermore, it lists only files which were modified
99 This flag changes the way a merge commit patch is displayed,
100 in a similar way to the `-c` option. It implies the `-c`
101 and `-p` options and further compresses the patch output
102 by omitting uninteresting hunks whose the contents in the parents
103 have only two variants and the merge result picks one of them
104 without modification. When all hunks are uninteresting, the commit
105 itself and the commit log message is not shown, just like in any other
109 Show the commit itself and the commit log message even
110 if the diff itself is empty.
113 include::pretty-formats.txt[]
114 include::diff-format.txt[]
118 Part of the linkgit:git[1] suite