Skip to content

Instantly share code, notes, and snippets.

@versedi
Last active August 29, 2015 14:27
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 versedi/56cb2b7fb2c3fb6b9a88 to your computer and use it in GitHub Desktop.
Save versedi/56cb2b7fb2c3fb6b9a88 to your computer and use it in GitHub Desktop.
Update multiple repositories in subdirectories
#!/bin/bash
find ~me/projects/ -type d -name .git \
| xargs -n 1 dirname \
| sort \
| while read line; do echo $line && cd $line && git pull; done
#If above ain't working (cygwin had some problems with syntax)
find . -type d -name .git -exec sh -c "cd \"{}\"/../ && pwd && git pull && git status" \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment