-
-
Save sankar4n/e948ba30c483e19340d154a41a4979a8 to your computer and use it in GitHub Desktop.
[GIT] Get tag of current branch(that is HEAD) or fallback to short commit hash(7 digits) by single shell command
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
git describe --exact-match --tags 2> /dev/null || git rev-parse --short HEAD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment