Created
June 30, 2016 15:20
-
-
Save bitdivine/7829a5f2aa8865420a2cda1bbe98c07f to your computer and use it in GitHub Desktop.
Check whether git is clean using plumbing methods
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
| if git ls-files -mo --exclude-standard | grep -q . | |
| then | |
| echo ":-X Dirty git. Say sorry:" | |
| read sorry ; [[ "${sorry:-unrepentant}" == "sorry" ]] || exit 1 | |
| else echo ":-) Git clean" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment