-
-
Save JellyWX/f6adc12613646a42f0387b3ef2fc5a88 to your computer and use it in GitHub Desktop.
Git pre-commit hook to prevent accidentally committing debug code (add NO_COMMIT in source comment)
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/bash | |
if git diff --cached | grep '^[+d].*NO_COMMIT'; then | |
echo "Can't commit file with NO_COMMIT comment, remove the debug code and try again" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment