Git changelog: how to get all changes up to a specific tag?
You can just do:
git log --oneline --decorate v0.1.0
... to show every commit up to and including v0.1.0. Of course, git log
allows also allows you to restrict the commits shown in any of the ways that git rev-list
understands, so if you only wanted to see the changes between v0.0.9
and v0.1.0
you could also do:
git log --oneline --decorate v0.0.9..v0.1.0
Alternative output that might be useful for this purpose is that of git shortlog
, which groups and summarizes the contributions of each author. Try, for example:
git shortlog v0.1.0
There is a very useful gem, the output is written in markdown, add issue support and split commits by tags
https://github.com/kebab-project/katip
For creating changelog by tags, i used this script:
#!/bin/bash
# Author:Andrey Nikishaev
echo "CHANGELOG"
echo ----------------------
git tag -l | sort -u -r | while read TAG ; do
echo
if [ $NEXT ];then
echo [$NEXT]
else
echo "[Current]"
fi
GIT_PAGER=cat git log --no-merges --format=" * %s" $TAG..$NEXT
NEXT=$TAG
done
FIRST=$(git tag -l | head -1)
echo
echo [$FIRST]
GIT_PAGER=cat git log --no-merges --format=" * %s" $FIRST