Find what file changed in a commit To find out which files changed in a given commit, use the git log --raw command.
Git stores history as a graph of snapshots of the entire repository. These snapshots, called commits in Git, can have multiple parents, creating a history that looks like a graph instead of a straight line.
This will give you a simple list of files, nothing else:
git log --no-merges --author="Pattern" --name-only --pretty=format:"" | sort -u
Switch --author for --committer as necessary.
This isn't the only way, but it works:
git log --pretty="%H" --author="authorname" |
while read commit_hash
do
git show --oneline --name-only $commit_hash | tail -n+2
done | sort | uniq
Or, as one line:
git log --pretty="%H" --author="authorname" | while read commit_hash; do git show --oneline --name-only $commit_hash | tail -n+2; done | sort | uniq
Try git log --stat --committer=<user>
. Just put the user's name on the --committer=
option (or use --author=
as appropriate).
This will spit out all the files per commit, so there will likely be some duplication.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With