Ever found yourself curious about how many commits you’ve contributed to a project? Or perhaps you’re interested in knowing which colleague has made significant changes (or maybe they have fewer commits but massive changes!) Well, wonder no more, because git shortlog provides a convenient way to find out.

Let’s say I’m running this on my clone of Jekyll, which is the engine behind this blog:

$ git shortlog -s -n
135 Tom Preston-Werner
15 Jack Danger Canty
10 Chris Van Pelt
7 Mark Reid
6 remi
3 Mikael Lind
3 Toby DiPasquale
2 Aristotle Pagaltzis
2 Basil Shkara
2 John Reilly
2 PJ Hyett
1 Marc Chung
1 Nick Gerakines
1 Nick Quaranto
1 Tom Kirchner

The -s option squashes all commit messages into a simple count of commits, while the -n option sorts the list by the number of commits.

This command can also be useful for generating changelogs, as you can easily list all the changes each person has made. There are a few other handy options available: -e appends emails, and you can control column widths with -w. For more information, check out the manpage.