Get all git commits since last tag

前端 未结 2 2020
没有蜡笔的小新
没有蜡笔的小新 2021-01-29 21:56

When I\'m going to tag a commit, I need to know what changed since the last tagged commit. Eg:

a87a6sdf87a6d4 Some new feature
a87a6sdf87a6d3 Some bug fix
a87a6s         


        
2条回答
  •  梦毁少年i
    2021-01-29 22:25

    If your current commit is also a tag and you want to dynamically get the changes since the previous tag, without knowing the latest tag nor previous tag name, you can do:

    git log --oneline $(git describe --tags --abbrev=0 @^)..@
    

    Note that @ is short for HEAD.

提交回复
热议问题