Skip to content

Instantly share code, notes, and snippets.

@mamachanko
Created January 6, 2015 10:43
Show Gist options
  • Save mamachanko/4d8684e58b037c2dc0c4 to your computer and use it in GitHub Desktop.
Save mamachanko/4d8684e58b037c2dc0c4 to your computer and use it in GitHub Desktop.
Update all matching repositories
#!/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