Skip to content

Instantly share code, notes, and snippets.

@NathanielInman
Created May 2, 2017 19:28
Show Gist options
  • Save NathanielInman/16c8cf78f252e2a06bb7c7e76adf679a to your computer and use it in GitHub Desktop.
Save NathanielInman/16c8cf78f252e2a06bb7c7e76adf679a to your computer and use it in GitHub Desktop.
Get hashes for git tags
# List all branches and their hashes on remote
git ls-remote --head
# List all tags and their hashes on a remote server
git ls-remote -t
# Get hash for a specific tag
git rev-parse v1.1.0
# Get last tag for current branch
git describe --tags --abbrev=0
# Get hash for last tag on current branch
git rev-parse $(git describe --tags --abbrev=0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment