Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I get git to tell me all the files one user has modified?

Tags:

git

People also ask

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

Find what file changed in a commit To find out which files changed in a given commit, use the git log --raw command.

How does git track history?

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.