Skip to content
Latchkey

git shortlog Command: Summarize Authors in CI

git shortlog summarizes commit history grouped by author, ideal for release credits.

Release automation uses shortlog to list who contributed since the last version. Its summary flags turn raw history into a tidy, attributed list.

Common flags

  • -s / --summary - show only a commit count per author, not the messages
  • -n / --numbered - sort authors by number of commits, descending
  • -e / --email - include the email address of each author
  • --no-merges - exclude merge commits
  • <from>..<to> - limit to a commit range (e.g. since the last tag)

Example

shell
# Contributors since the previous tag, ranked
PREV="$(git describe --tags --abbrev=0 HEAD^)"
git shortlog -sn --no-merges "${PREV}..HEAD"

In CI

shortlog -sn over a tag..HEAD range produces a ready-made contributor list for release notes. It reads commit metadata, so it needs full history; deepen shallow clones first. A .mailmap file consolidates duplicate author identities.

Key takeaways

  • git shortlog -sn ranks contributors by commit count for release credits.
  • Scope it with a tag..HEAD range to credit one release.
  • It needs full history, so it does not work on shallow clones.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →