Skip to content

crossrepo

crossrepo creates, syncs and removes the same git worktree branch across many sibling repos with one command. The command is xr.

When one change touches many repos, you make the same branch in each repo, keep each branch up to date, and clean up each one at the end. crossrepo does this for all the repos at once. Each change gets its own folder with one git worktree per repo, so you can work on two changes at the same time and never switch branches in your main repos.

To start, see Install and the Quick start.

Word What it is
codebase A folder that holds your repos side by side, plus a .crossrepo/ folder with the codebase config. xr codebase init makes a folder a codebase.
repo A git repo directly in the codebase folder and listed under repos: in the codebase config. Each repo needs an origin remote.
project One piece of work on one branch. It is a folder, by default in <codebase>/.projects/, with one worktree of each chosen repo. xr project create makes it, and xr project remove deletes it.
worktree A git worktree: a second folder of a repo, with its own branch checked out. The repo folder in the codebase stays on its own branch.

A branch feat/login gives the project folder .projects/feat--login/: each / becomes --.

Every command works the same way with --json, for scripts and agents. See Output and errors.

Each doctor prints each problem with its fix and changes nothing.

The source code is on GitHub.