Created
July 11, 2018 12:31
-
-
Save t-buss/3162933c70dc213fd1cbfdb4e09f941c to your computer and use it in GitHub Desktop.
Git Hook to not commit to master branch
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/sh | |
BRANCH=`git symbolic-ref --short HEAD` | |
if [ $BRANCH = "master" ] | |
then | |
echo "Error: commiting to master is probably not what you want. Create another branch." | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment