Skip to content

Instantly share code, notes, and snippets.

@hannesstruss
Created September 11, 2012 17:00
Show Gist options
  • Save hannesstruss/3699834 to your computer and use it in GitHub Desktop.
Save hannesstruss/3699834 to your computer and use it in GitHub Desktop.
Git PDB Pre Commit Hook
#!/bin/bash
git diff --cached | grep ^+ | grep 'pdb.set_trace()' > /dev/null
if [ $? = '0' ]; then
echo "You're about to commit code with pdb statements. Please remove them!"
echo "Run 'git diff --cached' to see what you're about to commit."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment