是否可以获取已提交/贡献特定文件的人数列表?我正在寻找这种输出:
git {blah} test.txt
JohnDoe@example.com
JaneDoe@example.com
John和Jane是唯一两个创建/编辑过test.txt的人
答案 0 :(得分:5)
您可以使用git log
的{{3}}格式化其输出。
git log --pretty=format:"%ae" test.txt
这会在单独的一行中为您提供每个提交作者的电子邮件。
答案 1 :(得分:4)
使用git log
并解压作者:
git log /path/to/file | grep ^Author: | sort | uniq -c | sort -n
(sort ...
管道计算每位作者的提交次数,并按数字对列表进行排序。)