A lightweight bash utility that discovers and manages all Git repositories within the current directory. Scans subdirectories for .git folders and performs batch git operations (fetch, status check, pull) across all discovered repositories in parallel, with real-time color-coded table display.
- Parallel Processing - All repositories are processed concurrently using background jobs
- Real-time Display - Live-updating color-coded table showing the status of each repository
- Auto-discovery - Automatically finds all Git repositories in subdirectories
- Smart Operations:
- Fetches from all remotes with pruning
- Shows branch and dirty/clean status
- Automatically pulls when behind remote (only if working directory is clean)
- Visual Feedback:
- Color-coded status (green=clean, yellow=dirty, red=error)
- Progress tracking with animated "working..." indicator
- Responsive terminal table that auto-sizes to content
# Clone the repository
git clone <repository-url>
cd gfash
# Copy to your bin directory (or any directory in your $PATH)
make deploy# Copy the script to a location in your PATH
cp gfa ~/bin/gfa
chmod +x ~/bin/gfaNavigate to a directory containing multiple Git repositories (or a single repository) and run:
gfaDIRECTORY BRANCH STATUS REMOTE ACTION
repo1 main clean up-to-date fetched
repo2 develop dirty ahead 2 fetched
repo3 feature clean behind 3 pulled
repo4 main clean no remote branch fetched
-
Status Column:
- 🟢
clean- Working directory is clean - 🟡
dirty- Uncommitted changes present - 🔴
error- Git operation failed - 🟡
no git- Directory is not a git repository
- 🟢
-
Remote Column:
- 🟢
up-to-date- Branch is synchronized with remote - 🟡
behind N- Local branch is behind remote by N commits (will auto-pull if clean) - 🟡
ahead N- Local branch is ahead of remote - 🟡
no remote/no remote branch- No remote configured
- 🟢
-
Action Column:
- 🟢
fetched- Successfully fetched from remotes - 🟢
pulled- Successfully pulled updates from remote
- 🟢
- Discovery Phase - Scans current directory for subdirectories containing
.gitfolders - Parallel Processing - Spawns a background process for each repository
- Per-Repository Operations:
- Verifies it's a valid Git repository
- Gets current branch name
- Checks for uncommitted changes (dirty/clean status)
- Fetches from all remotes with
--pruneand--prune-tags - Checks remote tracking status
- Auto-pulls if behind remote and working directory is clean
- Real-time Updates - Status table redraws as each operation completes
The script uses shellcheck for static analysis:
make lint- Bash 4.0+
- Git
MIT