git shortlog: Usage, Options & Common CI Errors
git shortlog groups commit subjects by author - the fast way to build contributor lists and changelogs.
shortlog is git log shaped for release notes. Pair it with a range and a mailmap for clean output.
What it does
git shortlog summarizes git log output by author, listing each author and the subject lines of their commits, optionally counting instead of listing.
Common usage
Terminal
git shortlog -sn # authors by commit count
git shortlog v1.0.0..HEAD # commits since a tag
git shortlog -sne # include emails
git log --no-merges | git shortlogOptions
| Flag | What it does |
|---|---|
| -s / --summary | Show counts, not commit subjects |
| -n / --numbered | Sort by number of commits |
| -e / --email | Show author email |
| --no-merges | Exclude merge commits |
| <range> | Limit to a commit range |
Common errors in CI
shortlog reads from a tty or piped log; in non-interactive CI pass an explicit range or pipe git log into it, otherwise it may wait for input. Authors split across multiple emails group separately - add a .mailmap to consolidate them.
Related guides
git log: Usage, Options & Common CI Errorsgit log shows commit history with flexible formatting. Reference for --oneline, --graph, --pretty, ranges, an…
git mailmap (.mailmap): Usage & Common CI ErrorsA .mailmap file canonicalizes author names and emails across log, shortlog, and blame. Reference for the form…
git describe: Usage, Options & Common CI Errorsgit describe produces a readable name from the nearest tag, ideal for build versions. Reference for --tags, -…