Files
git.taskfile.build/bin/pull-all-repos
T

25 lines
746 B
Bash
Executable File

#!/usr/bin/env bash
pull-all-repos(){
echo "Pull all git repos in $HOME."
repos=()
for repo in $(find "$HOME" -maxdepth 3 -type d -name '.git'); do
repos+=("$(basename "$(dirname "$repo")")")
done
echo "Repos to pull: ${repos[*]}"
for repo in $(find "$HOME" -maxdepth 2 -type d -name '.git'); do
dir=$(dirname "$repo")
echo "Pull $(git -C "$dir" branch --show-current) in $dir"
git -C "$dir" pull
echo "Pull submodules in $dir"