Reputation: 1249
I have a git-repo and need only the authors of a specific file. I can extract the authors from the git-blame command, but is there an easier way to get only the author names of a file?
Upvotes: 5
Views: 337
Reputation: 1617
This is usually what I want:
git log --format="%ad %an" -- $file
(includes the date of the commit)
Upvotes: 0
Reputation: 265956
git log --format=%an -- $file
will show you all commits for that file and only the authors for that commit. so you have one author per line
another easy solution would be to use git shortlog
git shortlog -s -- $file # add -n to sort by number of commits
Upvotes: 8