Last active
December 10, 2018 09:28
-
-
Save rmkrishna/11bd70e736e36863510d76e90f74cc8d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#Ref : https://gist.github.com/rponte/fdc0724dd984088606b0 | |
# The command finds the most recent tag that is reachable from a commit. | |
# If the tag points to the commit, then only the tag is shown. | |
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object | |
# and the abbreviated object name of the most recent commit. | |
git describe | |
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix: | |
git describe --abbrev=0 | |
# other examples | |
git describe --abbrev=0 --tags # gets tag from current branch | |
git describe --tags `git rev-list --tags --max-count=1` # gets tags across all branches, not just the current branch | |
================================================================================================================= | |
#Ref : https://gist.github.com/mobilemind/7883996 | |
# delete local tag '12345' | |
git tag -d 12345 | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :refs/tags/12345 | |
# alternative approach | |
git push --delete origin tagName | |
git tag -d tagName | |
================================================================================================================= | |
To get the most recent tag: | |
git describe --tags | |
To get the most recent annotated tag: | |
git describe --abbrev=0 --tags | |
================================================================================================================= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment