I use git shortlog -s -n --all
to show all the contributors in a git repository.
18756 Someone
6604 Someone Else
6025 Etc
5503 Another Committer
5217 And So On
I wonder if there is an option to show first n contributors. For example:
git shortlog -s -n --all --some-option 3
And the output will be:
18756 Someone
6604 Someone Else
6025 Etc
A solution would be use Unix pipes and head
:
git shortlog -s -n --all | head -3
...but if there is a built-in
On GitHub.com, navigate to the main page of the repository. Under your repository name, click Insights. In the left sidebar, click Contributors.
Git Log Oneline The oneline option is used to display the output as one commit per line. It also shows the output in brief like the first seven characters of the commit SHA and the commit message. It will be used as follows: $ git log --oneline.
There isn't a way of doing this with the native git shortlog
command. It's usually used to generate a contributors list between releases rather than a top n statistic.
Your approach of using pipes is likely to be the most efficient way of solving the problem; you could also use a script or git alias to do the same thing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With