Created
January 11, 2011 22:21
-
-
Save aantix/775277 to your computer and use it in GitHub Desktop.
Checks to see if there are any uncommitted files and alerts the git user that they need to add or ignore before proceeding.
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/sh | |
# | |
# .git/hooks/pre-commit | |
# | |
if git status -u | grep '^# Untracked files:$' | |
then | |
echo 'Files need to be either added ( git add .) or ignored (edit the .gitignore file) before a commit can be made.' | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment