Created
August 21, 2015 11:55
-
-
Save Florent2/8bd36b12016168f2d05f to your computer and use it in GitHub Desktop.
Git pre commit to abort commit if there are untracked files in the repository
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
if [[ -n $(git ls-files --other --exclude-standard) ]]; | |
then | |
echo "commit aborted, there are untracked files!" | |
exit 1 | |
else | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment