Skip to content

Instantly share code, notes, and snippets.

@ilyakatz
Created July 10, 2012 22:25
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 ilyakatz/3086596 to your computer and use it in GitHub Desktop.
Save ilyakatz/3086596 to your computer and use it in GitHub Desktop.
Disable commits to master
#!/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