7

Can I find out who modified given file last?

Can I also find out a list of changesets which affected a given file?

Roman
  • 64,384
  • 92
  • 238
  • 332

3 Answers3

13

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>
usha
  • 28,973
  • 5
  • 72
  • 93
5

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

carl verbiest
  • 1,113
  • 1
  • 15
  • 30
4

Try git log:

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

-n 1 makes it only load the lastest commit.

Simon Farshid
  • 2,636
  • 1
  • 22
  • 31