Git changelog: how to get all changes up to a specific tag?

前端 未结 9 2036
长情又很酷
长情又很酷 2021-01-31 09:37

Is there an easy way or command to get all git commits up to a specific tag to generate an automatic changelog for a project? I always tag my git repos with a version number lik

9条回答
  •  逝去的感伤
    2021-01-31 10:39

    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
    

提交回复
热议问题