Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
pre-commit prevent master commits
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
echo -e "[PREVENT] --> Prevent commit approved"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.