Last active
June 5, 2018 05:04
-
-
Save rishikeshdhokare/0f531eed7bf5ea40c752032c24ce6fd8 to your computer and use it in GitHub Desktop.
git pull all the repositories in a directory
This file contains hidden or 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 | |
for d in ./*/; | |
do ( | |
cd "$d" && | |
currentDir=`pwd` | |
echo "updating `basename "$currentDir"`..." | |
git pull | |
); | |
done |
For iTerm with zsh -
add the alias to .zshrc and source it
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Additionally add an alias for running this file -
Add following at the bottom of
.bashrc
filealias git_refresh='cd <directory containing multiple git repositories> && ./git_refresh.sh'