Skip to content

Instantly share code, notes, and snippets.

@jonpierce
Created April 4, 2018 15:30
Show Gist options
  • Save jonpierce/e442916c1bbee887f14b565f2c19d57d to your computer and use it in GitHub Desktop.
Save jonpierce/e442916c1bbee887f14b565f2c19d57d to your computer and use it in GitHub Desktop.
Perform a `git pull` on all repositories in the current directory
#!/usr/bin/env bash
BASE_DIR=$(pwd)
for git_dir in $(find . -name ".git" | cut -c 3-); do
repo_dir="${git_dir%/.git}"
echo "=========="
echo "Pulling ${repo_dir}..."
echo "=========="
cd "${repo_dir}"
git pull
echo ""
cd "${BASE_DIR}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment