Git fork
at reftables-rust 131 lines 4.2 kB view raw
1git-diff-tree(1) 2================ 3 4NAME 5---- 6git-diff-tree - Compares the content and mode of blobs found via two tree objects 7 8 9SYNOPSIS 10-------- 11[verse] 12'git diff-tree' [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty] 13 [-t] [-r] [-c | --cc] [--combined-all-paths] [--root] [--merge-base] 14 [<common-diff-options>] <tree-ish> [<tree-ish>] [<path>...] 15 16DESCRIPTION 17----------- 18Compare the content and mode of blobs found via two tree objects. 19 20If there is only one <tree-ish> given, the commit is compared with its parents 21(see --stdin below). 22 23Note that 'git diff-tree' can use the tree encapsulated in a commit object. 24 25OPTIONS 26------- 27include::diff-options.adoc[] 28 29<tree-ish>:: 30 The id of a tree object. 31 32<path>...:: 33 If provided, the results are limited to a subset of files 34 matching one of the provided pathspecs. 35 36-r:: 37 Recurse into sub-trees. 38 39-t:: 40 Show tree entry itself as well as subtrees. Implies -r. 41 42--root:: 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. 45 46--merge-base:: 47 Instead of comparing the <tree-ish>s directly, use the merge 48 base between the two <tree-ish>s as the "before" side. There 49 must be two <tree-ish>s given and they must both be commits. 50 51--stdin:: 52 When `--stdin` is specified, the command does not take 53 <tree-ish> arguments from the command line. Instead, it 54 reads lines containing either two <tree>, one <commit>, or a 55 list of <commit> from its standard input. (Use a single space 56 as separator.) 57+ 58When two trees are given, it compares the first tree with the second. 59When a single commit is given, it compares the commit with its 60parents. The remaining commits, when given, are used as if they are 61parents of the first commit. 62+ 63When comparing two trees, the ID of both trees (separated by a space 64and terminated by a newline) is printed before the difference. When 65comparing commits, the ID of the first (or only) commit, followed by a 66newline, is printed. 67+ 68The following flags further affect the behavior when comparing 69commits (but not trees). 70 71-m:: 72 By default, 'git diff-tree --stdin' does not show 73 differences for merge commits. With this flag, it shows 74 differences to that commit from all of its parents. See 75 also `-c`. 76 77-s:: 78 By default, 'git diff-tree --stdin' shows differences, 79 either in machine-readable form (without `-p`) or in patch 80 form (with `-p`). This output can be suppressed. It is 81 only useful with the `-v` flag. 82 83-v:: 84 This flag causes 'git diff-tree --stdin' to also show 85 the commit message before the differences. 86 87include::pretty-options.adoc[] 88 89--no-commit-id:: 90 'git diff-tree' outputs a line with the commit ID when 91 applicable. This flag suppresses the commit ID output. 92 93-c:: 94 This flag changes the way a merge commit is displayed 95 (which means it is useful only when the command is given 96 one <tree-ish>, or `--stdin`). It shows the differences 97 from each of the parents to the merge result simultaneously 98 instead of showing pairwise diff between a parent and the 99 result one at a time (which is what the `-m` option does). 100 Furthermore, it lists only files which were modified 101 from all parents. 102 103--cc:: 104 This flag changes the way a merge commit patch is displayed, 105 in a similar way to the `-c` option. It implies the `-c` 106 and `-p` options and further compresses the patch output 107 by omitting uninteresting hunks whose contents in the parents 108 have only two variants and the merge result picks one of them 109 without modification. When all hunks are uninteresting, the commit 110 itself and the commit log message are not shown, just like in any other 111 "empty diff" case. 112 113--combined-all-paths:: 114 This flag causes combined diffs (used for merge commits) to 115 list the name of the file from all parents. It thus only has 116 effect when -c or --cc are specified, and is likely only 117 useful if filename changes are detected (i.e. when either 118 rename or copy detection have been requested). 119 120--always:: 121 Show the commit itself and the commit log message even 122 if the diff itself is empty. 123 124 125include::pretty-formats.adoc[] 126 127include::diff-format.adoc[] 128 129GIT 130--- 131Part of the linkgit:git[1] suite