Manage multiple git repositories under a single parent folder with one command.
monogit gives you a monorepo workflow without a monorepo. Run git operations across all your linked repositories simultaneously β branching, committing, pushing, and more β with a single command.
- Interactive Setup β Scan a directory, detect existing repos, and optionally initialize new ones
- Unified Git Commands β Run
checkout,add,commit,push,pullacross all repos at once - Visual Split-Screen β View
status,log, anddifffor every repo in partitioned terminal boxes - Parallel Execution β All commands run concurrently across repos for maximum speed
- Error Resilience β One repo failing won't block the others
- Shell Autocompletion β Support for Bash and Zsh tab completion
npm i -g @frozencrow/monogitOnce installed, monogit is available as a global command.
Tab completion is automatically set up during installation for Zsh and Bash.
If it's not working, or if you need to set it up manually, you can run:
For Zsh:
echo 'source <(monogit completion zsh)' >> ~/.zshrc
source ~/.zshrcFor Bash:
echo 'source <(monogit completion bash)' >> ~/.bashrc
source ~/.bashrcNavigate to a parent directory that contains (or will contain) your git repositories, then run:
monogit initThis will:
- Scan all subdirectories
- Detect which ones are already git repositories
- Let you select which repos to link
- Offer to
git initany non-git directories you want to include - Save the configuration to
.monogit.json
# Create a new branch in all repos
monogit checkout -b feature/my-feature
# Check status across all repos
monogit status
# Stage all changes
monogit add .
# Commit everywhere
monogit commit -m "implement shared feature"
# Push to all remotes
monogit push origin feature/my-featureGenerate shell completion script for Bash or Zsh.
# Generate for Zsh (default)
monogit completion zsh
# Generate for Bash
monogit completion bashInteractively configure which repositories to manage.
monogit init- Scans the current directory for subdirectories
- Presents existing git repos for selection
- Offers to initialize git in non-repo directories
- Saves configuration to
.monogit.json
Switch branches across all linked repositories.
# Switch to an existing branch
monogit checkout main
# Create and switch to a new branch
monogit checkout -b feature/new-work| Option | Description |
|---|---|
-b |
Create a new branch |
Stage files across all linked repositories.
# Stage everything
monogit add .
# Stage specific files
monogit add src/ README.mdCommit staged changes across all linked repositories.
# Commit staged changes
monogit commit -m "your commit message"
# Stage and commit all tracked changes
monogit commit -am "your commit message"
# Commit specific paths
monogit commit -m "update docs" docs/| Option | Description |
|---|---|
-m <message> |
Required. Commit message |
-a |
Automatically stage modified/deleted files |
Push commits to remote repositories.
# Push (default remote/branch)
monogit push
# Push to a specific remote and branch
monogit push origin mainPull updates from remote repositories.
# Pull (default remote/branch)
monogit pull
# Pull from a specific remote and branch
monogit pull origin mainFetch updates from remote repositories.
# Fetch (default remote/branch)
monogit fetch
# Fetch from a specific remote and branch
monogit fetch origin mainMerge a branch into the current branch across all linked repositories.
# Merge a specific branch
monogit merge feature/my-featureList, create, or delete branches across all linked repositories.
# List branches (relative to the first repo)
monogit branch
# Create a new branch
monogit branch feature/new-idea
# Delete a branch
monogit branch -d stale-feature| Option | Description |
|---|---|
-d, --delete |
Delete a branch |
-D |
Force delete a branch |
View the git status of all linked repositories in a split-screen layout.
monogit statusEach repository's status is displayed in its own bordered box for easy scanning.
View recent commit history across all repositories.
monogit logShows the last 5 commits per repo in a compact graph format, each in a separate box.
View unstaged changes across all repositories.
monogit diffDisplays diffs for each repository in separate bordered boxes with color-coded output.
monogit stores its configuration in a .monogit.json file in the working directory:
{
"repos": [
"api",
"client",
"shared-lib"
]
}Each entry is a relative path to a subdirectory containing a git repository.
Tip: You can commit
.monogit.jsonto share configuration with your team, or add it to.gitignoreif it's personal.
monogit/
βββ index.js # CLI entry point
βββ package.json
βββ .monogit.json # Generated config (per workspace)
βββ src/
βββ commands/
β βββ init.js # Interactive repo linking
β βββ git-proxy.js # Parallel proxy for standard git commands
β βββ visual.js # Split-screen output for log/diff/status
β βββ completion.js # Shell completion script generation
β βββ complete.js # Dynamic branch completion logic
βββ utils/
βββ config.js # Read/write .monogit.json
βββ git.js # Git command execution via execa
βββ scripts/
β βββ postinstall.js # Automatic completion setup during npm install
- Commander.js β CLI framework
- Inquirer.js β Interactive prompts
- execa β Process execution
- chalk β Terminal styling
- ora β Spinners
- boxen β Boxed terminal output
ISC