Skip to content

Instantly share code, notes, and snippets.

@wwiill
Last active April 23, 2019 05:08
Show Gist options
  • Save wwiill/83063d3965cf973b662cefac7118c92f to your computer and use it in GitHub Desktop.
Save wwiill/83063d3965cf973b662cefac7118c92f to your computer and use it in GitHub Desktop.
#!/bin/bash
BASE_DIR=`pwd`
for REPO in $(find . -type d -d 1 | sed -e s/[\.\/]//g)
do
echo "Pulling $BASE_DIR/$REPO ..."
cd "$BASE_DIR/$REPO"
if [ "`git status | grep modified | wc -l`" -eq "0" ] ; then git pull; else echo "Skipping (has modified files)"; fi
done
cd "$BASE_DIR"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment