Home Explore Blog CI



git

1st chunk of `Documentation/git-diff-tree.adoc`
14cdcbe42738be0a892feea139b92e61ed7d37e9b4d308cc000000010000082f
git-diff-tree(1)
================

NAME
----
git-diff-tree - Compares the content and mode of blobs found via two tree objects


SYNOPSIS
--------
[verse]
'git diff-tree' [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty]
	      [-t] [-r] [-c | --cc] [--combined-all-paths] [--root] [--merge-base]
	      [<common-diff-options>] <tree-ish> [<tree-ish>] [<path>...]

DESCRIPTION
-----------
Compare the content and mode of blobs found via two tree objects.

If there is only one <tree-ish> given, the commit is compared with its parents
(see --stdin below).

Note that 'git diff-tree' can use the tree encapsulated in a commit object.

OPTIONS
-------
include::diff-options.adoc[]

<tree-ish>::
	The id of a tree object.

<path>...::
	If provided, the results are limited to a subset of files
	matching one of the provided pathspecs.

-r::
	Recurse into sub-trees.

-t::
	Show tree entry itself as well as subtrees.  Implies -r.

--root::
	When `--root` is specified the initial commit will be shown as a big
	creation event. This is equivalent to a diff against the NULL tree.

--merge-base::
	Instead of comparing the <tree-ish>s directly, use the merge
	base between the two <tree-ish>s as the "before" side.  There
	must be two <tree-ish>s given and they must both be commits.

--stdin::
	When `--stdin` is specified, the command does not take
	<tree-ish> arguments from the command line.  Instead, it
	reads lines containing either two <tree>, one <commit>, or a
	list of <commit> from its standard input.  (Use a single space
	as separator.)
+
When two trees are given, it compares the first tree with the second.
When a single commit is given, it compares the commit with its
parents.  The remaining commits, when given, are used as if they are
parents of the first commit.
+
When comparing two trees, the ID of both trees (separated by a space
and terminated by a newline) is printed before the difference.  When
comparing commits, the ID of the first (or only) commit, followed by a
newline, is printed.
+
The following flags further affect the behavior when comparing
commits (but not

Title: Git Diff Tree Command
Summary
The git-diff-tree command compares the content and mode of blobs found via two tree objects, providing options to customize the comparison, such as recursive sub-tree comparison, tree entry display, and merge base calculation.