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
# | |
# Paste this script in your .git/hooks/pre-commit file (create one if it doesn't exist yet) | |
# To prevent debug code from being accidentally committed, simply add a comment near your | |
# debug code containing the keyword !nocommit and this script will abort the commit. | |
# | |
if git commit -v --dry-run | grep '!nocommit' >/dev/null 2>&1 | |
then | |
echo "Trying to commit non-committable code." | |
echo "Remove the !nocommit string and try again." |