如何在命令行中查看 git 存储库中的所有标签
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3231079/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to see all tags in a git repository in command line
提问by marko
Is there something like "git show tags"?
有没有像“git show tags”这样的东西?
回答by jA_cOp
git tag
to list tags used in the repo.
git tag
列出 repo 中使用的标签。
git tag -l
if you use the -l
option you can pass a search pattern to filter out tags.
git tag -l
如果您使用该-l
选项,您可以传递一个搜索模式来过滤掉标签。
回答by VonC
git tag -l
git tag
-l <pattern>
List tags with names that match the given pattern (or all if no pattern is given).
Typing "git tag
" without arguments, also lists all tags
列出名称与给定模式匹配的标签(如果没有给出模式,则列出所有标签)。不带参数
输入“git tag
”,也会列出所有标签
See also GitHub tagging.
And I mentioned in "How to sort git tags by version string order of form rc-X.Y.Z.W?" to sort order used for listing tags.
另请参阅GitHub 标记。
我在“如何按 rc-XYZW 形式的版本字符串顺序对 git 标签进行排序?”中提到对用于列出标签的顺序进行排序。
回答by Sunil Dias
Use:
用:
git ls-remote --tags YOUR_REPOSITORY_NAME