Last active
August 24, 2017 09:41
-
-
Save barend/eb5e2777fce77ecb08646ff2890acb24 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
# Git pull all the repos two levels under $PWD, 4 in parallel | |
# vim: ft=zsh: | |
function woohoo() { | |
git -C "$1" pull --ff-only --recurse-submodules=yes --quiet 2>&1 | |
if [ ! $? ]; then | |
echo "Failed: $1" 1>&2 | |
fi | |
} | |
export -f woohoo | |
PROCS=4 | |
REPOS=$(find . -name '.git' -and -type d -depth 3 | xargs -n1 dirname) | |
time echo $REPOS | xargs -n 1 -P $PROCS -I % bash -c 'woohoo "$@"' _ % |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment