Last active
August 29, 2015 14:05
-
-
Save drewsberry/1e29aa7b3738580726bb to your computer and use it in GitHub Desktop.
Update all your git repositories within your development directory in one go.
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 | |
# Updates all my repositories in my ~/Dev folder. | |
# Requires `git-up`: `# gem install git-up` | |
REPO_DIR=$HOME/Dev # Replace with your development directory | |
cd $REPO_DIR | |
DIRS=`ls -d */` | |
dir_arr=$(echo $DIRS | tr "/" " ") | |
for dir in $dir_arr | |
do | |
echo "Changing directory into $dir..." | |
cd $dir | |
if [[ -d .git ]] | |
then | |
git-up && echo "Repository $dir successfully updated." | |
else | |
echo "Nothing to see here in $dir, moving on..." | |
fi | |
echo | |
cd .. | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment