Skip to content

Instantly share code, notes, and snippets.

@bobbwest
Last active December 6, 2015 03:02
Show Gist options
  • Save bobbwest/7e7ec1b811d276f8d8ba to your computer and use it in GitHub Desktop.
Save bobbwest/7e7ec1b811d276f8d8ba to your computer and use it in GitHub Desktop.
#!/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