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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

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

Okay