如何快速创建 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 "# <h1 style='font-size:18px;'>$NEWDATE</h1>" >> $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
标签:git,CHANGELOG,--,创建,NEXT,echo,DATE,changlog 来源: https://blog.51cto.com/u_15166492/2714332