Created
March 7, 2009 21:39
-
-
Save robolson/75456 to your computer and use it in GitHub Desktop.
Shell script to check multiple git repositories for updates.
This file contains 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
#!/bin/bash | |
repos=( | |
"/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[@]}" | |
do | |
echo "updating" ${repo} | |
cd "${repo}" | |
git pull | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rather than adding entries to$repos manually, you can try "for dir in $ (find . -name ".git")" .