List files modified for particular git commit [duplicate]

I have commit, abc, and I want to list files that were modified for the commit.

What is the git command which will list modified files for that commit?


Solution 1:

For filenames only:

git show --name-only abc

To see a summary of what happened to them:

git show --name-status abc

Solution 2:

You can see the files changed in a particular commit as follows

git show --stat <commit-hash>

Alternatively you can also view the patch introduced with each commit using the -p flag

git log -p <commit-hash>

BTW git show takes the same formatting arguments as git diff-tree, here's the documentation for diff-tree.