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
git log Command: Inspect History in CIgit log shows commit history. Reference for --oneline, -n, and --format to extract commit messages and author…
git rev-list Command: Count Commits in CIgit rev-list lists commit objects in reverse chronological order. Reference for --count to derive monotonic b…
git describe Command: Version Strings in CIgit describe builds a human-readable version from tags. Reference for --tags and --always to derive build ver…
git blame Command: Attribute Lines in CIgit blame shows which commit last changed each line. Reference for -L, --porcelain, and -w to attribute lines…