Skip to content

Instantly share code, notes, and snippets.

@re5et
Created May 19, 2011 17:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save re5et/981235 to your computer and use it in GitHub Desktop.
Save re5et/981235 to your computer and use it in GitHub Desktop.
git pre-commit hook to keep console.log out of commited code.
#!/bin/sh
has_console_log=$(git diff --cached | fgrep 'console.log')
if [ "$has_console_log" != "" ]
then
echo "ERROR: You have console.log in your commit. Remove them."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment