Last active
August 29, 2015 14:17
-
-
Save pkqk/e5622d7b29ab17ee731f to your computer and use it in GitHub Desktop.
pull all the repos
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
# for each match that is a directory with a git repo in it | |
for dir in */.git | |
do | |
# change into directory | |
# dirname gets rid of the .git | |
# quotes around $dir in case a name with spaces comes along | |
pushd `dirname "$dir"` | |
# fetch new updates | |
# but only pull them into your branch if you haven't changed anything | |
git fetch && git pull --ff-only | |
# change back to previous directory | |
popd | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment