DEV Community

samuel
samuel

Posted on

1

[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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay