Skip to content

Instantly share code, notes, and snippets.

@mminer
Created November 20, 2014 00:44
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 mminer/0537b24366cb7be46370 to your computer and use it in GitHub Desktop.
Save mminer/0537b24366cb7be46370 to your computer and use it in GitHub Desktop.
Lists a Git repository's tags with their corresponding SHA1 hashes.
#!/usr/bin/env bash
tags="$(git tag --list)"
for tag in $tags; do
hash="$(git rev-list $tag | head -n 1)"
echo "${hash} ${tag}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment