List files modified for particular git commit

GitGit Commit

Git Problem Overview


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?

Git Solutions


Solution 1 - Git

For filenames only:

git show --name-only abc

To see a summary of what happened to them:

git show --name-status abc

Solution 2 - Git

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAlphaView Question on Stackoverflow
Solution 1 - GitGreg BaconView Answer on Stackoverflow
Solution 2 - GitshantanusinghalView Answer on Stackoverflow