Keep a Changelog defines a changelog as a file containing a curated, chronological list of significant changes in each version of a project. It makes it easier for users and contributors to see what changed between versions.
A changelog is for the people who use and develop the software. In the Keep a Changelog approach, each version has its own entry. Changes of the same type are grouped together, and versions and sections can be linked. The latest version appears at the top of the list.
Create the file and change headings
Keep a Changelog recommends naming the file CHANGELOG.md. Some projects use HISTORY, NEWS, or RELEASES for the same purpose. It also recommends stating whether the project uses Semantic Versioning.
Group changes by type under each version. Keep a Changelog defines six headings for these groups:
Added: New features.Changed: Changes to existing functionality.Deprecated: Features slated for removal.Removed: Features that have been removed.Fixed: Bug fixes.Security: Changes related to security vulnerabilities.
Deprecated indicates that a feature will be removed in the future. Removed records that the feature has already been removed. Keep a Changelog calls for making it clear which changes may break compatibility during an upgrade.
The approach gives users a chance to upgrade to a version that lists deprecated features, stop using those features, and then move to the version that removes them. At a minimum, it calls for listing deprecations, removals, and breaking changes in the changelog.
Record significant changes consistently. According to Keep a Changelog, a change as small as removing a single space may only need to be recorded in some cases. Listing only some significant changes can leave readers with the impression that the list is complete.
Track unreleased changes separately
Keep a Changelog recommends keeping an Unreleased section at the top of the file to track upcoming changes. This section lets readers see what might be included in future versions.
When you publish a release, you can move the changes from Unreleased into a section for that version. In the Keep a Changelog example, version headings link to comparisons between Git tags.
Keep commit lists separate from changelog entries
Keep a Changelog advises against using commit log diffs directly as a changelog. These lists can contain merge commits, commits with unclear titles, and other changes.
A commit records a step in the evolution of the code. A changelog entry explains a change that matters to users. That change may span several commits. Keep a Changelog notes that some projects curate their commits and others leave their commit history as it is.
You can fill in gaps later. Keep a Changelog lists adding missing versions to a neglected changelog and documenting an overlooked breaking change in a version’s notes as reasons to update a changelog.
Mark yanked releases
According to Keep a Changelog, releases withdrawn because of a serious bug or security issue should still appear in the changelog. The approach uses [YANKED] in the version heading to flag these releases. The square brackets also make the marker easier to parse programmatically.
Yanked releases sometimes disappear from changelogs entirely. Keep a Changelog emphasizes making the marker visible so readers can spot the release’s status.
If you use Semantic Versioning
Keep a Changelog recommends stating whether you use Semantic Versioning. Semantic Versioning assigns a meaning to each part of a version number in the MAJOR.MINOR.PATCH format. Backward-incompatible API changes increment MAJOR, backward-compatible additions to functionality increment MINOR, and backward-compatible bug fixes increment PATCH.
Software that uses Semantic Versioning must declare a public API. The standard allows that API to be defined in the code itself. Marking public API functionality as Deprecated requires a MINOR version increment. A backward-incompatible change to the public API requires a MAJOR version increment.