A shell function that runs git pull on every git repository in the current directory and prints a color-coded summary table.
- Scans immediate subdirectories for git repos
- Pulls the currently checked-out branch in each repo
- Skips repos with uncommitted changes (with a warning)
- Detects submodules and runs
git submodule update --init --recursive - Prints a summary table with repo name, branch, status, submodule info, and details
- Color-coded output: green for success, yellow for skipped, red for failed
- Compatible with both bash and zsh
Pulling my-api... done
Pulling frontend... done
Pulling infra-charts... skipped
Pulling shared-lib... done
REPO BRANCH STATUS SUBMODULES DETAIL
──────────────────────────── ────────────────── ──────────────── ──────────── ────────────────────
my-api main ✓ pulled — 3 files changed, 10 insertions(+)
frontend develop ✓ up-to-date ✓ synced —
infra-charts main ⚠ SKIPPED yes uncommitted changes
shared-lib feat/new-parser ✓ pulled — 1 file changed, 2 insertions(+)
4 repos: 2 pulled, 1 up-to-date, 1 skipped, 0 failed
Add to your shell profile (.bashrc, .zshrc, or a shared file like .aliases):
source /path/to/git-pull.shOr paste the function directly into your profile.
cd ~/projects
git-pullReturns 0 if all repos pulled successfully, 1 if any were skipped or failed.