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?
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?
For filenames only:
git show --name-only abc
To see a summary of what happened to them:
git show --name-status abc
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.
For anyone who'd like to have an output summary like this for particular commit
Open your ~/.gitconfig file
add this script under [alias]:
swt = show --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --numstat
Save ~/.gitconfig file
Simply run git swt <commit-hash>