How to get the last person who modified a file in Git?

This command should give you all the commits that changed this file with the diff. You can also see who made this commit.

git log -p <filepath>

Try git log:

git log -n 1 -- path/to/file.html

-n 1 makes it only load the lastest commit.


I had the same question but found that the previous answers do not limit the output to the person as the OP asked.

Following will show the author with his/her email.

git log -s -n1 --pretty='format:%an %ae%n' <filepath>

see https://git-scm.com/docs/pretty-formats for more format options

Tags:

Git