Skip to content

Instantly share code, notes, and snippets.

@BillRizer
Created March 1, 2024 14:28
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 BillRizer/1a90e74647987b256ea5e15f9fa3cdd3 to your computer and use it in GitHub Desktop.
Save BillRizer/1a90e74647987b256ea5e15f9fa3cdd3 to your computer and use it in GitHub Desktop.
git pull in all projects. from projects within the current folder
#!/bin/bash
function git_pull_recursive() {
for dir in "$1"/*; do
if [ -d "$dir" ]; then
cd "$dir" || exit
if [ -d ".git" ]; then
echo "> Updating repository -> $(pwd)"
git pull
fi
git_pull_recursive "$dir"
cd ..
fi
done
}
git_pull_recursive "."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment