如何获取特定git分支的标签列表?

时间:2018-09-03 06:06:53

标签: git

我想要一个特定分支的标签列表。 以下是我的分支机构。

$ git分支

    master
  • master_release

    new_branch

    new_branch_1

    new_branch_2

git tag命令给出所有分支的标签列表。

我只需要

格式的master_release分支的标签列表

tag3

tag2

tag1

tag3是最新分支

1 个答案:

答案 0 :(得分:0)

我认为这将是git tag --list --merged

文档say

  

--merged [<commit>]

     

仅列出可从指定提交(如果未指定,则为HEAD)提交的列表标记,与--no-merged不兼容。


How to list all tags within a certain git branch

中还有一种更复杂的解释方式