multi worktree

One branch name. Many real Git repositories.

`mwt` gives independent repos a shared worktree workflow while keeping every repository, branch, merge, and failure mode visible.

feature-auth

$ mwt create feature-auth
created backend  -> worktrees/feature-auth/backend
created frontend -> worktrees/feature-auth/frontend
created infra    -> worktrees/feature-auth/infra

$ mwt status feature-auth
backend   feature-auth clean +2/-0
frontend  feature-auth dirty +1/-0
infra     feature-auth clean +0/-0

The model

Not a monorepo. Not a magic branch. Just coordinated Git.

Each source repository remains canonical. `mwt` records those repos in a local config file, creates real Git worktrees under a common directory, and runs standard Git commands inside each repo.

A multi-worktree name such as `feature-auth` becomes one branch per repository. The name is shared; the history is still independent.

workspace/
  mwt.yaml
  repos/
    backend/
    frontend/
    infra/
  worktrees/
    feature-auth/
      backend/
      frontend/
      infra/

Config

Let the tool keep the repo list current.

`mwt init` discovers non-nested Git repositories and writes their relative paths, current branches, and remotes. `mwt sync` repeats that scan, adding new repos and removing entries whose directories are gone.

worktree_root: ./worktrees
base_branch: main

repos:
  backend:
    path: ./repos/backend
    branch: main
    remotes:
      origin: git@github.com:org/backend.git

Commands

The daily loop is intentionally small.

01

Initialize

mwt init

Scan the workspace and create `mwt.yaml` from real Git repos.

02

Synchronize

mwt sync

Refresh paths, branches, and remotes after repos are added or removed.

03

Fetch a base

mwt fetch main

Fetch every canonical repo and check each one out to a common branch.

04

Create worktrees

mwt create feature-x

Create one real Git worktree per configured repository.

05

Inspect work

mwt status feature-x

Show branch, clean state, ahead/behind counts, and short status.

06

Run commands

mwt foreach feature-x -- go test ./...

Execute the same command inside every named worktree.

07

Snapshot

mwt snapshot feature-x

Print the exact commit in each repo before a risky operation.

08

Merge carefully

mwt merge feature-x --dry-run

Validate all repos before merging. Cross-repo merges are not atomic.

Install

One binary, released from tags.

Tagged releases publish archives, checksums, a changelog, and a Homebrew cask. The binary also includes a `version` command so you can check exactly what was installed.

install

$ brew tap towebuorg/tap
$ brew install --cask mwt
$ mwt version