Skip to content

Instantly share code, notes, and snippets.

@mattolenik
Created September 20, 2019 21:39
Show Gist options
  • Save mattolenik/48056a1c47cae2ab8a5dfa0e9c0b6fcb to your computer and use it in GitHub Desktop.
Save mattolenik/48056a1c47cae2ab8a5dfa0e9c0b6fcb to your computer and use it in GitHub Desktop.
Retrieve tag/branch/commit
git describe --tags --exact-match 2> /dev/null \
|| git symbolic-ref -q --short HEAD \
|| git rev-parse --short HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment