我使用 git shortlog -s -n --all
来显示 git 存储库中的所有贡献者。
18756 Someone
6604 Someone Else
6025 Etc
5503 Another Committer
5217 And So On
我想知道是否有显示前 n 个贡献者的选项。例如:
git shortlog -s -n --all --some-option 3
输出将是:
18756 Someone
6604 Someone Else
6025 Etc
一个解决方案是使用 Unix 管道和 head
:
git shortlog -s -n --all | head -3
...但是如果有一个内置的
最佳答案
没有办法使用 native git shortlog
命令执行此操作。它通常用于生成版本之间的贡献者列表而不是前 n 统计数据。
您使用管道的方法可能是解决问题的最有效方法;您也可以使用脚本或 git 别名来做同样的事情。
关于git - 显示 git 存储库中前 n 个最活跃的提交者,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31289244/