git ls-tree -r HEAD --name-only

Category: Git - Core

git ls-tree -r HEAD --name-only

List every file in a commit

Lists the full file tree of HEAD recursively, one path per line, without touching the working tree. The -r flag recurses into directories and --name-only suppresses hashes and modes. It answers what files a commit contains, not just the checkout.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.