Here is a list of tags I get when I do git describe --tags
:
v1.1.8
v1.1.9
v1.2.0
v1.2.0.1
v1.2.0.10
v1.2.0.11
v1.2.0.12
If I do
git describe --tags `git rev-list --tags --max-count=1`
I may get tag with either 3 digit or 4 digit. I only want to pick up the latest 4 digit tag. How can I always get the latest 4 digit git tag?
What I mean by the 4 digit tag is anything with vX.X.X.X
Edit: You write
(my emphasis)
However, your question really only makes sense for annotated tags, which, contrary to lightweight tags, do have a date associated to them. In that respect, a lightweight tag is not that much different from a branch reference.
To list all tags (either annotated or lightweight) in your repository that match the pattern
vX.X.X.X
(whereX
stands for one or more digits), runIf you want something else, please clarify your question.