Skip to content

Instantly share code, notes, and snippets.

@or9
Last active August 29, 2015 14:17
Show Gist options
  • Save or9/cf58d70da9766e6827c6 to your computer and use it in GitHub Desktop.
Save or9/cf58d70da9766e6827c6 to your computer and use it in GitHub Desktop.
Update script for looping through Git repos in a directory and updating each. Useful for Pathogen if using VIM
#!/bin/sh
# Example filesystem:
# ~/.vimrc/bundle/YouCompleteMe
# …nerdtree
# …molokai
# …clang_complete
# …vim-airline
#
# Usage (assuming this file's name is update.sh)
# cd ~/.vimrc/bundle
# ./update.sh
find . -type d -name .git \
| xargs -n 1 dirname \
| sort \
| while read line; do echo $line && cd $line && git pull && git submodule update --init --recursive && cd ..; done
exit $?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment