Skip to content

Instantly share code, notes, and snippets.

@asymmetric
Created September 13, 2011 10:16
Show Gist options
  • Save asymmetric/1213537 to your computer and use it in GitHub Desktop.
Save asymmetric/1213537 to your computer and use it in GitHub Desktop.
Git post commit hook to change RVM gemset
#!/usr/bin/env bash
source "$HOME/.rvm/scripts/rvm"
git_rev() {
ref=$(git symbolic-ref HEAD 2>/dev/null) || return
echo ${ref#refs/heads/}
}
ref=$(git_rev)
case $ref in
master)
gemset=jobs
;;
dev)
gemset=jobs31
;;
esac
echo "switching to gemset $gemset"
rvm gemset use $gemset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment