简体   繁体   中英

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

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
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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM