Skip to content

Frozen-Crow/monogit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ monogit

Manage multiple git repositories under a single parent folder with one command.

GitHub

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.


✨ Features

  • Interactive Setup β€” Scan a directory, detect existing repos, and optionally initialize new ones
  • Unified Git Commands β€” Run checkout, add, commit, push, pull across all repos at once
  • Visual Split-Screen β€” View status, log, and diff for 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

πŸ“¦ Installation

npm i -g @frozencrow/monogit

Once installed, monogit is available as a global command.

Enable Tab Completion

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 ~/.zshrc

For Bash:

echo 'source <(monogit completion bash)' >> ~/.bashrc
source ~/.bashrc

πŸ›  Getting Started

1. Initialize your workspace

Navigate to a parent directory that contains (or will contain) your git repositories, then run:

monogit init

This will:

  • Scan all subdirectories
  • Detect which ones are already git repositories
  • Let you select which repos to link
  • Offer to git init any non-git directories you want to include
  • Save the configuration to .monogit.json

2. Start working across repos

# 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-feature

πŸ“– Commands

monogit completion [shell]

Generate shell completion script for Bash or Zsh.

# Generate for Zsh (default)
monogit completion zsh

# Generate for Bash
monogit completion bash

monogit init

Interactively 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

monogit checkout <branch>

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

monogit add <paths...>

Stage files across all linked repositories.

# Stage everything
monogit add .

# Stage specific files
monogit add src/ README.md

monogit commit

Commit 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

monogit push [remote] [branch]

Push commits to remote repositories.

# Push (default remote/branch)
monogit push

# Push to a specific remote and branch
monogit push origin main

monogit pull [remote] [branch]

Pull updates from remote repositories.

# Pull (default remote/branch)
monogit pull

# Pull from a specific remote and branch
monogit pull origin main

monogit fetch [remote] [branch]

Fetch updates from remote repositories.

# Fetch (default remote/branch)
monogit fetch

# Fetch from a specific remote and branch
monogit fetch origin main

monogit merge <branch>

Merge a branch into the current branch across all linked repositories.

# Merge a specific branch
monogit merge feature/my-feature

monogit branch [branch]

List, 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

monogit status

View the git status of all linked repositories in a split-screen layout.

monogit status

Each repository's status is displayed in its own bordered box for easy scanning.


monogit log

View recent commit history across all repositories.

monogit log

Shows the last 5 commits per repo in a compact graph format, each in a separate box.


monogit diff

View unstaged changes across all repositories.

monogit diff

Displays diffs for each repository in separate bordered boxes with color-coded output.


βš™οΈ Configuration

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.json to share configuration with your team, or add it to .gitignore if it's personal.


πŸ— Project Structure

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

🧰 Built With


πŸ“„ License

ISC

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors