Created
January 6, 2015 10:43
-
-
Save mamachanko/4d8684e58b037c2dc0c4 to your computer and use it in GitHub Desktop.
Update all matching repositories
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 | |
# Usage: update_all <dir_prefix> <dir_prefix> ... | |
update_master () { | |
cd $1 | |
git checkout master | |
git pull upstream master | |
cd .. | |
} | |
update_all_master () { | |
for repo_dir in $1-*; do | |
update_master $repo_dir | |
done | |
} | |
for dir_prefix in $1; do | |
update_all_master $dir_prefix | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment