Last active
August 21, 2023 10:03
-
-
Save corbanmailloux/11076663 to your computer and use it in GitHub Desktop.
Loop through each subfolder of the current folder and call "git pull" in it.
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
# 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