How to get the latest tag name in current branch in Git?

前端 未结 24 2478
你的背包
你的背包 2020-11-22 17:04

What\'s the simplest way to get the most recent tag in Git?

git tag a HEAD
git tag b HEAD^^
git tag c HEAD^
git tag

output:



        
24条回答
  •  礼貌的吻别
    2020-11-22 17:28

    If you want to find the last tag that was applied on a specific branch you can try the following:

    git describe --tag $(git rev-parse --verify refs/remotes/origin/"branch_name")
    

提交回复
热议问题