public
Last active

Reload .rvmrc after git checkout

  • Download Gist
gistfile1.sh
Shell
1 2 3
# Put this is your .profile, .bashrc or similar to automatically reload your .rvmrc after git checkouts
 
git() { command git "$@" ; if [[ "$@" == *checkout* ]]; then [[ -s .rvmrc ]] && . .rvmrc; fi }

A small improvement:

git() { command git "$@"; if [[ "$1" == *checkout* ]] || [[ "$1" == *co* ]]; then [[ -s .rvmrc ]] && . .rvmrc; fi }

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.