When I’m preparing a new release of one of my plugins, its Git commit history is a great starting point to use when writing the changelog.
Rather than dealing with a bunch of parameters in git log
, I use a simple Git alias which generates a plain list of the commit messages between the previous tag and the current HEAD. I can then copy and paste this into my changelog, and go from there.
[alias]
changelog = "!_() { t=$(git describe --abbrev=0 --tags); git log ${t}..HEAD --no-merges --pretty=format:'* %s'; }; _"
Add it to your ~/.gitconfig
file and then simply run git changelog
to get your list of commit messages.
That’s a good time-saver. Thanks for sharing!
Thanks, this is great.
Something cool for other people: if you want to add additional details to the changelog, modify the `–pretty=format` section using these rules: https://git-scm.com/docs/git-log#_pretty_formats