Skip to content

Instantly share code, notes, and snippets.

@martijngastkemper
Last active August 29, 2015 14:13
Show Gist options
  • Save martijngastkemper/880a1adb35c677d08b9c to your computer and use it in GitHub Desktop.
Save martijngastkemper/880a1adb35c677d08b9c to your computer and use it in GitHub Desktop.
Checkout a tag or a branch.
# version=2.3.4
# version=master
if [ "`git tag -l $version`" == "" ]; then
git checkout -qf $version
git pull -q
else
versionRef=`git rev-list -n 1 $version`
git checkout -qf $versionRef
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment