0

I wanted to see list of commits and user who committed it for a file using git command.

Say i have a file in git path /home/git/xml/a.xml in master branch

Now, i wanted get list of commits and user who did the commit etc on above file.

Please let me know the command to get it.

1 Answer 1

1

You can use git log with the filename here:

git log xml/a.xml

assuming your project is in /home/git.

You can try something on the line of git log -n5 <filename>, to limit the numbers of commits shown.

2
  • Thanks. Its giving huge history. how to control. say display only last 5 changes
    – logan
    Commented May 14, 2015 at 10:54
  • 1
    @logan You can try something on the line of git log -n5 <filename>, to limit the numbers of commits shown. If that helped, don't forget to accept and upvote :) Commented May 14, 2015 at 11:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.