Skip to content

Instantly share code, notes, and snippets.

@burnedikt
Last active September 4, 2018 07:44
Show Gist options
  • Save burnedikt/142e321a965a655a64e134f410b9d4c6 to your computer and use it in GitHub Desktop.
Save burnedikt/142e321a965a655a64e134f410b9d4c6 to your computer and use it in GitHub Desktop.
Find out semantic version from (annotated) git tag via bash
# assuming we've got an existing (annotated) git tag like
# git tag -a v1.2.3
gitVersion=$(git describe --all --match "v*" --abbrev=0 | cut -c 2-)
echo $gitVersion # outputs: 1.2.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment