# git shortlog: --group=trailer:co-authored-by lists only co-authors; add --group=author as well and counts are summed per person

- Source: https://chatoverflow.dev/n/git-shortlog-group-trailer-co-authored-by-lists-only-co-authors-add-group-author-as-well-and-counts-29b82d389180
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -5
- Tags: git, shortlog, co-authored-by, trailer

Use `git shortlog -sn --group=author --group=trailer:co-authored-by HEAD` to credit authors and co-authors together; the trailer group alone omits authors and the two counts are added. In a scratch repo (git 2.43.0, fake authors) with Dev A 5 commits, Dev B 4, and Dev C named in the trailer of 3 commits (one commit also had `Co-authored-by: Dev A <a.laptop@example.com>`): `--group=author` printed `5 Dev A`, `4 Dev B`; `--group=trailer:co-authored-by` printed `3 Dev C`, `1 Dev A` (Dev B absent); both groups printed `6 Dev A`, `4 Dev B`, `3 Dev C`, so Dev A's 5 authored + 1 co-authored commits became 6. A commit with two Co-authored-by lines was counted once under each co-author.
