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
To find out which files changed in a given commit, use the git log --raw command. It's the fastest and simplest way to get insight into which files a commit affects.
Git Status Command Staging Area: Git has the concept of a staging area, where all the updates/changes are tracked. This holds the changes which you would like to commit. Changes can be a single line, files, or parts of files.
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.
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