Skip to content

Instantly share code, notes, and snippets.

@galtenberg
Created November 17, 2010 18:34
Show Gist options
  • Save galtenberg/703788 to your computer and use it in GitHub Desktop.
Save galtenberg/703788 to your computer and use it in GitHub Desktop.
Switch rvm after git checkout
#!/bin/bash
#Filename: .git/hooks/post-checkout
#Note: make sure to chmod +x post-checkout
CURRENT=`git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\\ \1/'`
if [ $CURRENT = "upgrade" ]; then
rvm use r19
else
rvm use system
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment