Skip to content

Instantly share code, notes, and snippets.

@StevenBlack
Last active April 16, 2022 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StevenBlack/1c2a2bb1908fc02dedf113a28c820d72 to your computer and use it in GitHub Desktop.
Save StevenBlack/1c2a2bb1908fc02dedf113a28c820d72 to your computer and use it in GitHub Desktop.
git pull in all sub directories
# 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