Skip to content

Instantly share code, notes, and snippets.

@dstokes
Last active August 29, 2015 14:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dstokes/c3477ddd5da1fa0eb245 to your computer and use it in GitHub Desktop.
Save dstokes/c3477ddd5da1fa0eb245 to your computer and use it in GitHub Desktop.
Create a CHANGELOG.md with Bash + Git
#!/bin/bash
# vim: set syntax=sh :
#
# Generate a changelog
#
git tag | sort -r | awk '
/^v/ {
# print commit log diff
if(NR>1)
system("git log " $1 "..." prev " --pretty=format:\"- [%s](http://github.com/<owner>/<repo>/commit/%H) \" | tail -n+2")
# print tag header
print "\n\n##" $1;
prev=$1
}' > CHANGELOG.md
@d48
Copy link

d48 commented Dec 4, 2014

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment