Skip to content

Instantly share code, notes, and snippets.

@wayneeseguin
Created March 1, 2011 12:29
Show Gist options
  • Select an option

  • Save wayneeseguin/849058 to your computer and use it in GitHub Desktop.

Select an option

Save wayneeseguin/849058 to your computer and use it in GitHub Desktop.
Git checkout function that triggers project .rvmrc to be reloaded
#
# Call git checkout
#
gco()
{
git checkout $*
if [[ -s .rvmrc ]] ; then
unset rvm_rvmrc_cwd
cd .
fi
}
# Usage Examples
$ gco my_branch
$ gco -b my_new_branch
$ gco -b my_new_branch -t origin/new_branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment