DEV Community

samuel
samuel

Posted on

[git] find semantic version tags

Sure, you could use grep/sed, but can it be done with glob(7)? Supply a pattern to git describe or git tag to print the matching tags.

git tag --list 'v[[:digit:]]*[\.][[:digit:]]*[\.][[:digit:]]*'
Enter fullscreen mode Exit fullscreen mode

Maybe there's a better way 🤷🏼.

Why?

In a ci/cd environment, I wanted to be able to build and publish new releases of a binary if and when the latest commit has a semantic version tag attached.

Top comments (0)