Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Shell script to check multiple git repositories for updates.
"/Users/rob/Library/Application Support/TextMate/Bundles/Git.tmbundle"
"/Users/rob/Library/Application Support/TextMate/Bundles/Ruby.tmbundle"
"/Users/rob/Library/Application Support/TextMate/Bundles/RubyAMP.tmbundle"
"/Users/rob/Library/Application Support/TextMate/Bundles/Ruby Haml.tmbundle"
"/Users/rob/Library/Application Support/TextMate/Bundles/Ruby on Rails.tmbundle"
"/Users/rob/Library/Application Support/TextMate/Bundles/ruby-sass.tmbundle"
"/Users/rob/Library/Application Support/TextMate/Bundles/ruby-shoulda.tmbundle"
echo "Checking" ${#repos[@]} "repositories for updates"
for repo in "${repos[@]}"
echo "updating" ${repo}
cd "${repo}"
git pull

rather than adding entries to $repos manually, you can try "for dir in $(find . -name ".git")" .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment