Created
January 25, 2015 15:07
-
-
Save floscher/ad41bac476bdcc2dee2f to your computer and use it in GitHub Desktop.
update-hook for
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This hook checks for whitespace problems and rejects pushing them (even with --force). | |
# Put this in the ./hooks/ directory on your (server-)repository. | |
# With the core.whitespace-attribute in your git-configuration you can control for which | |
# problems it should check (see http://www.git-scm.com/docs/git-config for possible values). | |
echo "Checking for whitespace problems introduced between $2 and $3" | |
git diff --check $2 $3 | |
exit `git diff --check $2 $3 | wc -l` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment