By admin , 29 April 2026

Synopsis

git shortlog [-n] [-s] [-e] [<revision-range>]

Description

The git shortlog command groups commits by author, producing concise summaries suitable for release notes, contributor lists, and quick "who did what" overviews. By default it prints each author's name followed by the subject lines of their commits in the given range.

Common modes include -sn (summary, sorted by count) for "top contributors" lists and --no-merges to ignore merge commits. Combined with a range like v1.0..v2.0, shortlog is the fastest way to draft release-note credits.

In day-to-day use, git shortlog integrates closely with shell aliases, editor plugins, and continuous integration. Power users often add aliases that combine flags they always pass, or wrap the command in scripts that enforce team conventions. Output formatting can be customized via Git config — pretty formats, color schemes, and pager behavior are all tunable. When something goes wrong, the first diagnostic step is usually to re-run the command with GIT_TRACE=1 in the environment, which reveals the underlying plumbing calls. For unusual situations, the --help output (git shortlog --help) opens the full manual page with details on every option, including those rarely used in casual workflows but essential for debugging or scripting at scale.

Understanding how git shortlog interacts with the rest of Git's data model — the object database, the index, refs, and the working tree — pays dividends. Each command operates on some subset of these pieces, and knowing which it touches helps predict outcomes and recover from mistakes. Reading the official Git documentation alongside hands-on practice in a throwaway repository is the fastest way to internalize the nuances. Most production issues with Git stem from one of three causes: surprising default behavior, partial network operations, or rewriting history that was already shared. A working mental model of git shortlog's side effects helps avoid all three.

Common Options

OptionDescription
-s, --summaryShow only counts per author.
-n, --numberedSort authors by commit count.
-e, --emailInclude author email addresses.
--no-mergesExclude merge commits.
--group=<type>Group by author, committer, or trailer.
-w[<width>]Wrap subject lines.

Examples

git shortlog -sn
# Top contributors all-time, with counts

git shortlog -sne v1.0..v2.0
# Contributors between two releases, with emails

git shortlog --no-merges HEAD~50..HEAD
# Subjects grouped by author for the last 50 commits

git shortlog --group=trailer:co-authored-by
# Group by Co-authored-by trailer

Common Mistakes

Multiple commit identities for the same person (different emails, different name capitalizations) inflate the contributor count. A .mailmap file at the repo root canonicalizes them. Forgetting --no-merges can attribute many merge commits to project maintainers.

Related Commands

git log, git blame, git describe, git tag