Last active
February 15, 2017 14:27
-
-
Save hadynz/912885cc4b67e955df98 to your computer and use it in GitHub Desktop.
Checkout the latest tag of a Git repository
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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