Created
September 25, 2013 16:15
-
-
Save getdave/6702061 to your computer and use it in GitHub Desktop.
Git Pre-Commit hook bash script to stop people committing directly to the master branch. Typically useful in a GitFlow based workflow. Installation would be as simple as ````
ln -s ../../pre-commit.sh .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
git branch | grep "* master" && echo 'COMMIT REJECTED - you are not allowed to commit directly to the master branch you fool!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment