Created
August 13, 2011 09:45
-
-
Save ardbytes/1143695 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/zsh | |
# post-checkout hook to adjust heroku.remote based on the branch being checked out. | |
# | |
# Do nothing on file checkout | |
[[ $3 -eq 0 ]] && exit | |
echo "Fixing heroku.remote" | |
current_branch=$(git symbolic-ref HEAD) | |
# production is a local branch tracking remote branch production/master. Likewise with staging. | |
[[ "refs/heads/production" == $current_branch ]] && git config heroku.remote production && exit | |
[[ "refs/heads/staging" == $current_branch ]] && git config heroku.remote staging && exit | |
git config --unset heroku.remote | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment