LinuxCommandLibrary

git-changelog

Generate a changelog from Git history

TLDR

Update existing file or create a new History.md file with the commit messages since the latest Git tag

$ git changelog
copy

List commits from the current version
$ git changelog [[-l|--list]]
copy

List a range of commits from the tag named 2.1.0 to now
$ git changelog [[-l|--list]] [[-s|--start-tag]] 2.1.0
copy

List pretty formatted range of commits between the tag 0.5.0 and the tag 1.0.0
$ git changelog [[-s|--start-tag]] 0.5.0 [[-f|--final-tag]] 1.0.0
copy

List pretty formatted range of commits between the commit 0b97430 and the tag 1.0.0
$ git changelog --start-commit 0b97430 [[-f|--final-tag]] 1.0.0
copy

Specify CHANGELOG.md as the output file
$ git changelog CHANGELOG.md
copy

Replace contents of current changelog file entirely
$ git changelog [[-p|--prune-old]]
copy

SYNOPSIS

git-changelog [OPTIONS] [REPO_DIR]

PARAMETERS

--output, -o FILE
    Write changelog to FILE (default: stdout).

--template TEMPLATE
    Path to custom Handlebars template file.

--since TAG
    Start changelog from this tag/version.

--until TAG
    Stop changelog before this tag/version.

--unreleased
    Include a section for unreleased changes.

--tag TAG
    Specify unreleased version tag.

--header TEMPLATE
    Custom header template file.

--no-merge
    Exclude merge commits from changelog.

--pretty FORMAT
    Custom git log pretty format string.

--grep REGEX
    Include only commits matching regex.

--invert-grep
    Exclude commits matching --grep regex.

--author AUTHOR
    Filter commits by author name/email.

--help
    Print help and exit.

--version
    Print version and exit.

DESCRIPTION

git-changelog is a lightweight command-line tool written in Rust that automatically generates changelogs from a Git repository's commit history. It excels at parsing conventional commit messages (feat:, fix:, etc.) and grouping changes by semantic version tags, producing structured Markdown output by default.

It scans git tags to delineate versions (e.g., v1.0.0), categorizes commits into sections like Added, Changed, Fixed, and Deprecated, and supports unreleased changes. Customizable via templates, it allows filtering by date, author, or grep patterns, ignoring merges if desired.

Ideal for open-source projects following Conventional Commits, it outputs to file or stdout, making it perfect for CI/CD pipelines to automate CHANGELOG.md updates before releases. Unlike git log pipes, it provides ready-to-use formatted changelogs with minimal configuration.

CAVEATS

Requires a Git repository with tags for best results; assumes Conventional Commits for categorization. Run from repo root or specify path. Limited to linear history unless --no-merge used.

CONFIGURATION

Supports ~/.config/git-changelog/config.toml for defaults like templates and output format.

EXAMPLES

git-changelog --output CHANGELOG.md --unreleased
git-changelog --since v1.0.0 ../myrepo

HISTORY

Developed by Fahrstuhl (Fabian Möller) in Rust for fast performance. Initial release v0.1.0 in 2020; actively maintained with semantic versioning support added in v0.5+. Available via Cargo, Homebrew, and distro packages.

SEE ALSO

Copied to clipboard