Skip to content

Commit

Permalink
Add a simplistic but useful Git hook.
Browse files Browse the repository at this point in the history
  • Loading branch information
doublep committed Aug 10, 2023
1 parent 2ed17db commit 4e962a3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

# This can be used in a comment as a reminder to self.
git diff-index --cached -S "DONOTCOMMIT" HEAD --patch --exit-code ":!githooks" \
|| { echo; echo "Have you forgotten about the “DONOTCOMMIT”?"; exit 1; }

0 comments on commit 4e962a3

Please sign in to comment.