开发者

How can i get just the authors of a specific file from a git-repo?

I have a git-repo and need only the authors of a specific file. I can extract开发者_JAVA百科 the authors from the git-blame command, but is there an easier way to get only the author names of a file?


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


This is usually what I want:

git log --format="%ad %an" -- $file

(includes the date of the commit)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜