Git block commit if TODO is found
up: Git
.git/hooks/pre-commit
#!/bin/sh
if git-diff-index -p -M --cached HEAD -- \
| grep '^+' \
| grep TODO; then
echo "Blocking commit as TODO was found."
exit 1
fi
Search
Nov 26, 2024
up: Git
.git/hooks/pre-commit
#!/bin/sh
if git-diff-index -p -M --cached HEAD -- \
| grep '^+' \
| grep TODO; then
echo "Blocking commit as TODO was found."
exit 1
fi