Snippets

osman a git pre-commit hook to prevent debugging being committed

Created by osman a
if test "$(git diff --cached | grep '\+.*binding\.pry')"
then
  echo "Error: Attempt to commit a binding.pry line"
  echo
  echo "To skip this check, add the --no-verify option"
  echo
  exit 1
fi

if test "$(git diff --cached | grep '\+.*byebug')"
then
  echo "Error: Attempt to commit a byebug line"
  echo
  echo "To skip this check, add the --no-verify option"
  echo
  exit 1
fi

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.