Skip to content

Instantly share code, notes, and snippets.

@Ry4an

Ry4an/pre-commit

Created Feb 13, 2014
Embed
What would you like to do?
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
#!/bin/sh
#
if git diff --cached | grep --quiet 'KILL ME' ; then
echo FORGOT TO REMOVE KILL ME
exit 1
fi
@eytoss

This comment has been minimized.

Copy link

@eytoss eytoss commented Mar 15, 2014

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment