Created
March 18, 2020 16:03
-
-
Save seniv/2dd56c7f6019e9188d41468b1484c8e9 to your computer and use it in GitHub Desktop.
Block commits on master and develop branches (add to "pre-commit" hook)
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
BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
if [ $BRANCH == 'develop' -o $BRANCH == 'master' ] | |
then | |
echo "ERROR: Making commits to master or develop branches are not allowed." | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment