Created
February 12, 2016 08:28
-
-
Save Kornel/12977767391bf0073549 to your computer and use it in GitHub Desktop.
Pull all git subdirectories - if successful, be quiet.
This file contains 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
#!/usr/bin/env bash | |
quiet_git() { | |
tempfile=`mktemp /tmp/git-pull-all-XXXXXXXX` | |
stdout=$tempfile | |
stderr=$tempfile | |
if ! git "$@" </dev/null >$stdout 2>$stderr; then | |
cat $stderr >&2 | |
rm -f $stdout $stderr | |
fi | |
rm -f $stdout $stderr | |
} | |
export -f quiet_git | |
for i in `find . -type d -depth 1` | |
do | |
if [ -d $i/.git ] | |
then | |
echo "Pulling ${i}" | |
quiet_git -C $i pull | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment