Skip to content

Instantly share code, notes, and snippets.

@linmic
Created January 24, 2015 15:28
Show Gist options
  • Save linmic/1331136309c433641172 to your computer and use it in GitHub Desktop.
Save linmic/1331136309c433641172 to your computer and use it in GitHub Desktop.
#!/bin/sh
# credit: https://github.com/creationix/nvm/issues/400#issuecomment-49511425 by mzgol
set -e
cd ~/.nvm
git fetch --tags
TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "Checking out tag $TAG..."
git checkout "$TAG"
source ~/.nvm/nvm.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment