Skip to content

Instantly share code, notes, and snippets.

@hadynz
Last active February 15, 2017 14:27
Show Gist options
  • Save hadynz/912885cc4b67e955df98 to your computer and use it in GitHub Desktop.
Save hadynz/912885cc4b67e955df98 to your computer and use it in GitHub Desktop.
Checkout the latest tag of a Git repository
# Get new tags from the remote
git fetch --tags
# Get the latest tag name
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
# Checkout the latest tag
git checkout $latestTag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment