Reputation: 14086
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?
Upvotes: 76
Views: 86268
Reputation: 3041
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>
Upvotes: 3
Reputation: 139711
For filenames only:
git show --name-only abc
To see a summary of what happened to them:
git show --name-status abc
Upvotes: 106
Reputation: 724
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.
Upvotes: 35