Skip to content

Instantly share code, notes, and snippets.

@walchko
Last active August 23, 2017 04:23
Show Gist options
  • Save walchko/74cfcd12fcc6477b7116c12b6d32110f to your computer and use it in GitHub Desktop.
Save walchko/74cfcd12fcc6477b7116c12b6d32110f to your computer and use it in GitHub Desktop.
Update git repos
#!/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