Skip to content

Instantly share code, notes, and snippets.

@NicolasRitouet
Created November 29, 2013 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NicolasRitouet/7703303 to your computer and use it in GitHub Desktop.
Save NicolasRitouet/7703303 to your computer and use it in GitHub Desktop.
Git multiple pull
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
find "$DIR" -type d -name .git \
| xargs -n 1 dirname \
| sort \
| while read line; do echo $line && cd $line && git pull; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment