6

Can I find out who modified given file last?

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

Roman
  • 61,962
  • 88
  • 232
  • 324

3 Answers3

11

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,179
  • 5
  • 69
  • 91
4

Try git log:

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

-n 1 makes it only load the lastest commit.

Simon Farshid
  • 2,526
  • 1
  • 21
  • 31
4

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
  • 789
  • 1
  • 10
  • 26