Files in a commit

A git command that provides a nicely formatted list of all files that were part of the commit given by a hash (SHA1), with no extraneous information.

git diff-tree --no-commit-id --name-only -r a123b456

or

git show --pretty="" --name-only a123b456

ELI5

The --no-commit-id suppresses the commit ID output.

The --pretty argument specifies an empty format string to avoid the cruft at the beginning.

The --name-only argument shows only the file names that were affected

The-r argument is to recurse into sub-trees

Credit StackOverflow