Home·Terminal commands

git shortlog

git

Usage

git shortlog -sne [<revision-range>]

Groups commits by author and counts them, handy for release notes; one person with two email addresses counts twice unless a .mailmap merges them.

Common flags

FlagMeaning
-scounts only, no subjects
-nsort by number of commits
-eshow the email address as well
-cgroup by committer instead of author
--no-mergesleave merge commits out of the count
--since=<date>only commits after a date

Examples

git shortlog -sne

every contributor with a commit count

git shortlog -sn v1.1.0..v1.2.0

who did what between two releases

git shortlog --no-merges -sn --since="1 year ago"

this year, merges excluded

The confusion is that undo has several shapes — moving where a branch points is not the same as adding a commit that reverses it.

How to read this

  • Square brackets [ ] mark a part you may leave out.
  • An ellipsis … means you can list more than one.
  • Flags are case-sensitive — in some commands -r and -R do different things.

Questions

Q. What does git shortlog do?

Groups commits by author and counts them, handy for release notes; one person with two email addresses counts twice unless a .mailmap merges them.

Q. How do I type it?

git shortlog -sne [<revision-range>] — square brackets mark the parts you can leave out.

Q. How many flags are worth knowing?

6 are listed here; the full set is in man git. This command sits under git.

Related commands

man page: man git-shortlog