Created
February 23, 2021 22:25
-
-
Save stevewithington/4d1b7dbf6eecd5e6ecaf512b43f67576 to your computer and use it in GitHub Desktop.
Git: Get Latest Tag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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