Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

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
like image 701
coiax Avatar asked Dec 26 '18 04:12

coiax


People also ask

How do you find list of files that have been changed in a particular commit?

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.

Does git track all changes?

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.


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

like image 70
ElpieKay Avatar answered Oct 25 '22 16:10

ElpieKay