Skip to content

Instantly share code, notes, and snippets.

@stevewithington
Created February 23, 2021 22:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevewithington/4d1b7dbf6eecd5e6ecaf512b43f67576 to your computer and use it in GitHub Desktop.
Save stevewithington/4d1b7dbf6eecd5e6ecaf512b43f67576 to your computer and use it in GitHub Desktop.
Git: Get Latest Tag
# get latest tag for the current branch
git describe --tags
# outputs > v*.*.*-{hash}
# get latest tag for the current branch without the hash
git describe --tags --abbrev=0
# outputs > v*.*.*
# get latest tag across all branches
git describe --tags $(git rev-list --tags --max-count=1)
# outputs > v*.*.*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment