List all files changed by a specific user in a Git repository

Viewed 2793

How do I get a list of all files changed by a specific user in a Git repository?

Using $ git blame will tell you who has changed each line of a file, but that's only limited to one file, includes the whole line by default, and doesn't include historic changes that might have been overwritten.

I would like some command (or short script) that will produce a list of all files changed by a specific user.

code/modules/abacus.dm
code/game/world.dm
interface/stylesheet.css
2 Answers
git log --pretty= --committer=<username> --name-only | sort -u

--pretty= suppresses the contents of commit logs as you don't need them here. --committer=<username> limits the output to commits whose committer is username. If you want author name, use --author=<username> instead. --name-only prints the changed files of these commits. sort -u sorts the list and removes redundant files.

This will give the list of all the files changed by the author:

git whatchanged --author="author name" --no-commit-id --name-only

Related