如何快速创建 git 的 changlog

创建脚本 changelog-generate.sh , 内容如下

#!/bin/bash
# Generates changelog day by day
NEXT=$(date +"%Y.%m.%d")
CHANGELOG=./CHANGELOG.md
rm -rf $CHANGELOG
echo $CHANGELOG
echo "# CHANGELOG" >> $CHANGELOG
echo "----------------------" >> $CHANGELOG

git log --no-merges --format="%cd" --date=short | sort -u -r | while read DATE ; do
    echo >> $CHANGELOG
    NEWDATE=$(echo "${DATE//-/.}" )
    echo "# 

$NEWDATE

" >> $CHANGELOG GIT_PAGER=$(git log --no-merges --format=" * %s" --since=$DATE --until=$NEXT) echo "$GIT_PAGER" >> $CHANGELOG NEXT=$DATE done echo "CHANGE LOG CREATE SUCCESS"

执行 changelog-generate.sh ,输出

CHANGELOG.md

你可能感兴趣的:(软件研发,高效与创新,shell,php,linux,python,docker)