Skip to content

Instantly share code, notes, and snippets.

@mminer
Created November 20, 2014 00:44
Show Gist options
  • Select an option

  • Save mminer/0537b24366cb7be46370 to your computer and use it in GitHub Desktop.

Select an option

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