Fast bulk git operations across multiple repositories.
gbulk is a CLI tool that discovers git repositories recursively in a directory tree and executes git commands in parallel. Perfect for managing monorepos, workspace setups, or directories containing multiple git projects.
- Fast Parallel Execution: Runs operations across all repositories simultaneously
- Recursive Discovery: Automatically finds all git repositories in a directory tree
- Smart Pull: Advanced
pull-allcommand with auto-stash, branch switching, and gone branch cleanup - Custom Commands: Execute any git command across all repositories with
exec - Submodule Support: List and update git submodules across all repos
- Real-time Feedback: Live spinner updates showing progress for each repository
- Error Resilient: Individual repository failures don't stop other operations
npm install -g gbulknpm install gbulk
npx gbulk [command]git clone https://github.com/joeystdio/gbulk.git
cd gbulk
npm install
npm run build
npm linkgbulk [options] <command>-d, --directory <path>: Base directory to search for repositories (default: current directory)
List all git repositories found in the directory tree.
# List repos in current directory
gbulk list
# List repos in a specific directory
gbulk -d ~/projects listPull all repositories with advanced features:
- Fetches with
--prune - Detects "gone" branches (deleted on remote)
- Auto-switches from gone branches to fallback branches (develop/main/master)
- Updates ALL local branches via rebase with
--autostash - Restores original branch
- Updates submodules if
.gitmodulesexists
# Pull all repositories
gbulk pull-all
# Auto-confirm prompts (skip gone branch deletion prompt)
gbulk pull-all --yes
gbulk pull-all -y
# Preview changes without making modifications
gbulk pull-all --dry-runRun a custom git command in all repositories.
# Check status of all repos
gbulk exec status
# Show short status
gbulk exec status -s
# Create a branch in all repos
gbulk exec checkout -b feature/new-feature
# View recent commits
gbulk exec log --oneline -5
# Any git command works
gbulk exec fetch --all
gbulk exec stash list
gbulk exec diff --statList all repositories that contain git submodules.
gbulk submodule-listUpdate submodules in all repositories that have them.
gbulk submodule-updatecd ~/workspace
gbulk pull-all --yesgbulk exec status -sgbulk exec fetch --all --prunegbulk exec checkout -b feature/update-dependenciesgbulk exec branch --list "*feature*"- Discovery:
gbulkrecursively searches the directory tree for.gitfolders (excludesnode_modules) - Parallel Execution: All operations run concurrently for maximum performance
- Individual Spinners: Each repository gets real-time status updates
- Summary Report: After completion, see which repos succeeded, failed, or had warnings
- Node.js >= 18.0.0
- npm or pnpm
git clone https://github.com/joeystdio/gbulk.git
cd gbulk
npm install# Build TypeScript to dist/
npm run build
# Watch mode for development
npm run dev# After building
node dist/index.js [command]
# Or use the bin file
./bin/gbulk [command]gbulk/
├── src/
│ ├── index.ts # CLI entry point
│ ├── commands/ # Command implementations
│ │ ├── list.ts
│ │ ├── pull-all.ts # Most complex command
│ │ ├── exec.ts
│ │ ├── submodule-list.ts
│ │ └── submodule-update.ts
│ └── utils/
│ ├── repos.ts # Repository discovery
│ ├── git.ts # Git operations wrapper
│ └── results.ts # Result formatting
├── bin/
│ └── gbulk # Executable wrapper
└── dist/ # Compiled output
- Node.js >= 18.0.0
- Git installed and available in PATH
MIT
Contributions are welcome! Please feel free to submit a Pull Request.
Found a bug or have a feature request? Please open an issue at: https://github.com/joeystdio/gbulk/issues
Jo Jo (joeystdio@gmail.com)