Created
March 14, 2013 01:23
-
-
Save igrep/5158053 to your computer and use it in GitHub Desktop.
Prevent you from committing on important branches.
This file contains hidden or 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
| #!/bin/bash | |
| current_branch=$(git rev-parse --abbrev-ref HEAD) | |
| warn_branch() { | |
| echo "You can't commit on '$current_branch'!" | |
| } | |
| case $current_branch in | |
| master) warn_branch; exit 1 ;; # Of cource you can add any other important branches as you need. | |
| *) exit 0;; | |
| esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment