git shortlog for Release Notes: Usage & CI Errors
git shortlog between two tags is the simplest reliable way to draft release notes in a pipeline.
This pattern turns a commit range into grouped, deduplicated release notes - with the CI caveats that trip teams up.
What it does
Run against a tag-to-HEAD range, git shortlog groups commit subjects by author so a release job can emit a contributor-attributed changelog without external tooling.
Common usage
Terminal
# notes since the previous tag:
PREV=$(git describe --tags --abbrev=0 HEAD^)
git shortlog --no-merges "$PREV"..HEAD
# just the contributor list:
git shortlog -sne "$PREV"..HEADCommon errors in CI
git shortlog without a range or piped input can block waiting on stdin in non-interactive CI - always pass an explicit range. fatal: No names found / a bad PREV happens when no earlier tag exists or tags were not fetched; guard the describe call and set fetch-depth: 0.
Related guides
git shortlog: Usage, Options & Common CI Errorsgit shortlog summarizes commits grouped by author, perfect for changelogs and release notes. Reference for -s…
git describe: Usage, Options & Common CI Errorsgit describe produces a readable name from the nearest tag, ideal for build versions. Reference for --tags, -…
git log: Usage, Options & Common CI Errorsgit log shows commit history with flexible formatting. Reference for --oneline, --graph, --pretty, ranges, an…
git tag: Usage, Options & Common CI Errorsgit tag creates and lists tags for releases. Reference for -a, -m, -d, pushing tags, and the "tag already exi…