Created
September 20, 2017 08:51
-
-
Save stereosupersonic/e42e4eeb62259246cf6c47a59b6c9259 to your computer and use it in GitHub Desktop.
pre-commit prevent master commits
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] --> Non shall commit to master!" | |
exit 1 | |
else | |
echo -e "[PREVENT] --> Prevent commit approved" | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment