multree
Spins up linked git worktrees across several repos at once, with hooks and env wiring between them.
- Node.js
- TypeScript
- git
- YAML
What it is
A command-line orchestrator for git worktrees across more than one repository. You describe a group of repos in a YAML profile, and multree creates a matching set of linked worktrees, runs per-repo setup hooks, primes the heavy build artifacts, and wires each repo’s env file to values the others expose. One command gets you a complete, working, isolated copy of a multi-repo system.
Why I built it
Worktrees solve the “I need a second checkout” problem beautifully, right up until your system is five repos that have to agree with each other. Then the worktree is the easy ten percent. The rest is installing dependencies, rebuilding whatever takes four minutes to build, and hand-editing the env file in the frontend so it points at the port this particular copy of the backend is listening on.
Running agents in parallel turned that annoyance into a blocker. Several sessions each want their own isolated copy of the whole system, and a setup ritual that takes fifteen minutes and three mistakes doesn’t survive being run six times a day. The tool exists because I wanted the ritual to be a single command that either works or fails loudly.
How it works
A profile names the repos, the branch to base on, the hooks to run, and the relationships between them. Creating a group makes the worktrees, then walks the hooks in dependency order. Producer repos expose values like ports, URLs and generated credentials, and consumer repos get those values written into their env files, so the copies are internally consistent instead of all pointing at whatever was there before.
Artifact priming is the piece that makes it practical. Heavy directories are cloned with APFS reflinks rather than copied outright, so a fresh worktree group costs seconds and almost no disk where it used to cost minutes and gigabytes.
Where it is now
Published on npm as multree-cli and running my daily setup. It’s opinionated about how you describe a group and deliberately incurious about what you do inside one. There’s a worked profile in the README to start from.