Examples (4)
List the contents of the tree on a branch
git ls-tree branch_nameList the contents of the tree on a commit, recursing into subtrees
git ls-tree -r commit_hashList only the filenames of the tree on a commit
git ls-tree --name-only commit_hashPrint the filenames of the current branch head in a tree structure (Note: `tree --fromfile` is not supported on Windows)
git ls-tree -r --name-only HEAD | tree --fromfilemade by @shridhargupta | data from tldr-pages