If you don't want to commit changes that contains debugger or binding.pry into the repo.
Add the following code in ~/.git_template/hooks/pre-commit
#! /usr/bin/env bash
ruby_files=`git status --short | grep -v '^D' | awk '{print $2}' | grep '.rb$'`
while read -r file; do
result=`grep -rin 'binding.pry\|debugger' $file`
if [ -n "$result" ]
then
echo "Cannot be commited because: $result ."
exit 1
fi
done <<< "$ruby_files"
Then:
chmod u+x ~/.git_template/hooks/pre-commit
Your hook will be installed the next time that you git init. You can even use git init on an existing repo.
The next time that you will try to commit an unwanted word, you will warned and the commit will be aborted.
If you want to commit your changes anyway, you can:
git commit -n