Last active
August 29, 2015 14:07
-
-
Save yoshikischmitz/180a573cf405d75d941c to your computer and use it in GitHub Desktop.
.git/hooks/pre-commit
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/sh | |
# | |
# Prevents commits to master. | |
# Put in .git/hooks/pre-commit | |
# Bypass with --no-verify flag on commit | |
if [ $(git rev-parse --abbrev-ref HEAD) = "master" ]; | |
then | |
echo "You cannot commit to master" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment