Created
July 10, 2012 22:25
-
-
Save ilyakatz/3086596 to your computer and use it in GitHub Desktop.
Disable commits to master
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 | |
if [[ `git symbolic-ref HEAD` == "refs/heads/master" ]] | |
then | |
if [[ ! -f /tmp/master_commit ]] | |
then | |
echo "*************************" | |
echo "CANNOT COMMIT TO MASTER!" | |
echo "To override this behavior" | |
echo "touch /tmp/master_commit" | |
echo "*************************" | |
exit 1 | |
else | |
echo "Removing /tmp/master_commit" | |
rm /tmp/master_commit | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment