Created
February 13, 2014 15:57
-
-
Save Ry4an/8977721 to your computer and use it in GitHub Desktop.
Put this in your repo's www/.git/hooks as pre-commit to make sure you can't commit with 'KILL ME' in a line
This file contains hidden or 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 | |
# | |
if git diff --cached | grep --quiet 'KILL ME' ; then | |
echo FORGOT TO REMOVE KILL ME | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You won't be able to modify a line with an existing
KILL ME
as well, not even the lines around it.Now I know how to protect my code :)