Created
March 1, 2024 14:28
-
-
Save BillRizer/1a90e74647987b256ea5e15f9fa3cdd3 to your computer and use it in GitHub Desktop.
git pull in all projects. from projects within the current 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 | |
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