Skip to content

Instantly share code, notes, and snippets.

@CraZySacX
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CraZySacX/2bdff464e0e63ae6b01a to your computer and use it in GitHub Desktop.
Save CraZySacX/2bdff464e0e63ae6b01a to your computer and use it in GitHub Desktop.
post-checkout hook for updating multirust override on checkout based on branch name
#!/bin/bash
# Place this file in your <project>/.git/hooks directory.
# Note the name has to be post-checkout and the file should
# be executable.
BRANCH=$(git rev-parse --abbrev-ref HEAD)
case $BRANCH in
"master")
multirust remove-override
;;
"beta")
multirust override beta
;;
"stable")
multirust override stable
;;
* )
echo "Branch not recognized, override not changed!"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment