Git worktree workspace manager. Creates multi-repo workspaces using git worktrees instead of symlinks.
When you symlink repos into a workspace directory, tools that resolve paths (IDEs, sandboxes, Claude Code) see the real paths outside your workspace and prompt for permissions or lose context. Worktrees create real directories inside the workspace — same files, shared git object store, no path resolution issues.
brew install cemcatik/tap/git-rigcurl --proto '=https' --tlsv1.2 -LsSf https://github.com/cemcatik/git-rig/releases/latest/download/git-rig-installer.sh | shpowershell -ExecutionPolicy Bypass -c "irm https://github.com/cemcatik/git-rig/releases/latest/download/git-rig-installer.ps1 | iex"cargo install --git https://github.com/cemcatik/git-rigPre-built binaries are available on the releases page.
cargo install --path .The installed binary git-rig is also available as git rig (git auto-discovers git-* binaries on your PATH).
From the directory where your repos live:
cd ~/projects
git rig create my-featuregit rig add takes a path to a locally cloned repo (relative or absolute):
cd ~/projects/my-feature
git rig add ../api-server # new branch rig/my-feature from default
git rig add ../web-app --branch feature/PROJ-123 # specific branch
git rig add ~/projects/infra/auth-service --remote upstream # repo from a different directory
git rig add ../api-server --detach # read-only, detached HEAD
git rig add ../api-server --name api # custom name in rigWhen outside a workspace, pass the workspace name first:
git rig add my-feature ../api-servergit rig statusWorkspace: my-feature (/Users/you/projects/my-feature)
api-server on rig/my-feature [dirty] +2 -5
last: a1b2c3d fix auth token refresh (2 hours ago)
web-app on feature/PROJ-123
last: d4e5f6a add tenant validation (3 days ago)
git rig sync # all repos in current workspace
git rig sync --stash # auto-stash dirty repos before rebasingSyncing workspace 'my-feature'
ok api-server 702a039 -> 069c37c
ok web-app already up to date
SKIP auth-service (dirty — use --stash to auto-stash)
ok All repos synced
git rig exec -- git status # run in all repos
git rig exec --repo api-server -- make # run in specific repo(s)
git rig exec --fail-fast -- cargo test # stop on first failure
git rig exec -w my-feature -- git pull # target a workspace by nameIf upstream repos change their default branch (e.g. master → main), refresh the manifest:
git rig refreshgit rig remove api-server
git rig remove api-server --force # remove even if worktree is dirty
git rig remove api-server --keep-branch # keep the branch in the source repo (default: deleted)git rig listgit rig destroy my-feature
git rig destroy my-feature --dry-run # preview what would be removed
git rig destroy my-feature --keep-branches # keep branches in source reposThis removes all worktrees, deletes their branches, and removes the workspace directory. Force-removes dirty worktrees.
Each workspace is a directory containing a .rig.json manifest:
{
"name": "my-feature",
"repos": [
{
"name": "api-server",
"source": "/Users/you/projects/api-server",
"branch": "rig/my-feature",
"default_branch": "master",
"remote": "origin"
}
]
}- Each repo entry stores the absolute
sourcepath to the local git clone - Repos can live anywhere on disk — they don't need to be siblings of the workspace
- Worktrees are created inside the workspace directory
- Commands that accept an optional workspace name (
add,remove,status,sync,refresh,exec) auto-detect the workspace by walking up from CWD
cargo test # all tests (89)
cargo test --bin git-rig # unit tests — manifest ops, workspace resolution
cargo test --test git_test # integration tests — git operations against real repos
cargo test --test cli_test # E2E tests — full CLI commands via assert_cmdTests create temporary git repos (bare remote + clone) per test case — no shared state, no CWD mutation.
scripts/release.sh 0.2.0This bumps the version in Cargo.toml, updates Cargo.lock, commits, tags, and pushes. The tag push triggers the release workflow which builds binaries, creates a GitHub Release, and publishes the Homebrew formula.
- A git branch can only be checked out in one worktree at a time. If
git rig addfails with "already checked out", the branch exists in another worktree. - Default branch detection requires
origin/HEAD(or<remote>/HEAD) to be set. For repos not created viagit clone, run:git remote set-head origin --auto git rig destroyforce-removes worktrees.git rig removedoes not — it fails on dirty worktrees unless--forceis passed.- You can edit
.rig.jsondirectly to change remotes, branches, or other settings.