Last active
December 6, 2015 03:02
-
-
Save bobbwest/7e7ec1b811d276f8d8ba 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 | |
# Pull down all gists unless there are local changes not checked in. | |
# For a discussion of using "git diff --exit-code", see http://stackoverflow.com/a/5139672/4263262 | |
GISTDIR=$HOME/tmp/gists | |
for gist in $GISTDIR/*.gist | |
do | |
( | |
cd $gist | |
git diff --exit-code && git diff --cached --exit-code && git pull --quiet | |
) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment