Last active
August 18, 2020 11:48
-
-
Save himito/4a4d1160fa098361ed2768f423c348cf to your computer and use it in GitHub Desktop.
Script to pull all the git repository in a folder
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 | |
# store the current dir | |
CUR_DIR=$(pwd) | |
# Let the person running the script know what's going on. | |
printf "\nPulling in latest changes for all repositories...\n" | |
# Find all git repositories and update it to the master latest revision | |
for i in $(find . -name ".git" -type d); do | |
printf "\n$i"; | |
# We have to go to the .git parent directory to call the pull command | |
git --git-dir "$i" fetch -q --all | |
done | |
printf "\n\nComplete!\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment