Last active
August 23, 2017 04:23
-
-
Save walchko/74cfcd12fcc6477b7116c12b6d32110f to your computer and use it in GitHub Desktop.
Update git 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
#!/bin/bash | |
# | |
# Update a bunch of git repos on command | |
# | |
set -e | |
# get a list of non-hidden directories | |
shopt -u dotglob | |
# iterate through list | |
for d in */; do | |
echo "========================" | |
echo " ${d%/}" | |
echo "========================" | |
cd ${d%/} | |
if [[ -d ".git" ]]; then | |
git pull | |
git status | |
fi | |
cd .. | |
echo "" | |
echo "" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment