Created
November 10, 2017 09:42
-
-
Save misostack/90c77dd4baa99bad94a428cad249aac8 to your computer and use it in GitHub Desktop.
pre-commit-prevent-master
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
#!/bin/bash | |
echo -e "[PREVENT] --> init (wait a second)" | |
BRANCH=`git rev-parse --abbrev-ref HEAD` | |
if [ $BRANCH == master ]; then | |
echo -e "[PREVENT] --> You are not allowed to commit to master!" | |
exit 1 | |
else | |
echo -e "[PREVENT] --> Prevent commit passed" | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment