Skip to content

diff-tree

Compares the content and mode of blobs found via two tree objects.

See the files changed in a specific commit

Section titled “See the files changed in a specific commit”
git diff-tree [--stdin] [-m] [-c] [--cc] [-s] [-v] [--pretty] [-t] [-r] [--root] [<common-diff-options>] <tree-ish> [<tree-ish>] [<path>...]
OptionExplanation
-rdiff recursively
—rootinclude the initial commit as diff against /dev/null
OptionExplanation
-zoutput diff-raw with lines terminated with NUL.
-poutput patch format.
-usynonym for -p.
—patch-with-rawoutput both a patch and the diff-raw format.
—statshow diffstat instead of patch.
—numstatshow numeric diffstat instead of patch.
—patch-with-statoutput a patch and prepend its diffstat.
—name-onlyshow only names of changed files.
—name-statusshow names and status of changed files.
—full-indexshow full object name on index lines.
—abbrev=abbreviate object names in diff-tree header and diff-raw.
-Rswap input file pairs.
-Bdetect complete rewrites.
-Mdetect renames.
-Cdetect copies.
—find-copies-hardertry unchanged files as candidate for copy detection.
-llimit rename attempts up to paths.
-Oreorder diffs according to the .
-Sfind filepair whose only one side contains the string.
—pickaxe-allshow all files diff when -S is used and hit is found.
-a —texttreat all files as text.