git-ls-tree
List tree object contents
TLDR
List tree contents
SYNOPSIS
git ls-tree [options] tree-ish [path]
DESCRIPTION
git ls-tree lists the contents of a tree object, showing file names, modes, types, and object hashes for a specific commit's directory structure. It provides a snapshot of the repository's file layout at any given commit.
The command is useful for scripting and understanding how Git stores directory contents internally. Recursive mode (`-r`) shows all files across all subdirectories, while `--name-only` provides clean output suitable for piping to other commands.
PARAMETERS
TREE-ISH
Tree or commit to list.PATH
Limit to path.-r
Recurse into subtrees.-d
Show only trees.--name-only
Show only names.--name-status
Show names and status.-l, --long
Show object sizes.--abbrev N
Abbreviate hashes.--help
Display help information.
CAVEATS
Shows tree at specific commit. Plumbing command for scripts. Output format is machine-readable.
HISTORY
git ls-tree is a core Git plumbing command for examining tree objects, part of git's low-level interface.
SEE ALSO
git-ls-files(1), git-ls-remote(1), git-show(1)
