# Get new tags from remotegit fetch --tags# Get latest tag namelatestTag=$(git describe --tags `git rev-list --tags --max-count=1`)# Checkout latest taggit checkout $latestTag
In some repositories the git describe --tags gives no info and a simple git tag | tail -1 can get you the wrong tag as git sorts tags in a strange way.
For me the best command is a variation of the tail one