FahamLah

Commands

git ls-tree

git ls-tree [-r] [--name-only] <tree-ish> [<path>]

Risk: Safe

What it does

Lists the files and folders inside one tree.

When to use it

To see what a commit saved, without checking it out.

Example

$ git ls-tree HEAD

List the top folder of the newest commit.

$ git ls-tree -r --name-only HEAD~1

List every file of an older commit.