Last active
April 16, 2022 21:15
-
-
Save StevenBlack/1c2a2bb1908fc02dedf113a28c820d72 to your computer and use it in GitHub Desktop.
git pull in all sub directories
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
# Run "git pull" in each subdirectory of the current directory. | |
# Useful when you store all of your git repos in one folder. | |
clear | |
for dir in ./*; # For every item in the folder: | |
do ( | |
if [ -d "$dir" ]; # If it is a directory: | |
then ( | |
echo "$dir" && # Print the path, | |
cd "$dir" && # Change directory into the path, | |
git pull && # Pull in the path, | |
echo . # Toss in a new line for readability. | |
); | |
fi | |
); | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment