Created
January 25, 2014 20:37
-
-
Save Genki-S/8623216 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
# See file status life cycle: http://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository | |
untracked=$(git status --porcelain 2>/dev/null | grep "^??") | |
modified=$(git status --porcelain 2>/dev/null | grep "^ M") | |
staged=$(git status --porcelain 2>/dev/null | grep "^M") | |
if [ -n "$untracked" -o -n "$modified" -o -n "$staged" ]; then | |
echo "Working tree not clean." 1>&2 | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment