LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

git-diff-tree

Compare content of tree objects

TLDR

Compare two trees
$ git diff-tree [tree1] [tree2]
copy
Show changes in commit
$ git diff-tree -p [commit]
copy
Show changed files
$ git diff-tree --name-only [commit]
copy
Raw output
$ git diff-tree --raw [commit]
copy

SYNOPSIS

git diff-tree [options] tree-ish [tree-ish] [files...]

DESCRIPTION

git diff-tree compares the content and mode of blobs found via two tree objects, providing low-level access to Git's internal tree comparison mechanism. This plumbing command forms the foundation for examining differences between commits, branches, or any tree-like structures in Git's object database.The command accepts one or two tree-ish arguments and outputs the differences in various formats. It can process commits via stdin, enabling efficient batch processing of history. While rarely needed in daily Git use, it underpins many higher-level operations and is essential for scripts and custom diff tools.

PARAMETERS

-r

Recurse into subtrees.
-p, --patch
Generate patch.
--raw
Raw diff format.
--name-only
Show file names only.
--name-status
Show status and names.
-s
Suppress diff output.
--stdin
Read commits from stdin, one per line; each is compared with its parent(s).
--root
Include the initial commit as a big-bang diff against the empty tree (only meaningful with --stdin or a single tree-ish).
-c, --cc
Show a combined diff for merge commits instead of only listing changed files.

INSTALL

sudo apt install git
copy
sudo dnf install git
copy
sudo pacman -S git
copy
sudo apk add git
copy
sudo zypper install git
copy
brew install git
copy
nix profile install nixpkgs#git
copy

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid