git worktree manager · v0.10.0

Git worktrees without
the setup friction.

git worktree add is the easy part. .env files, node_modules, build caches, install scripts — that's where every team gives up. Grove automates it.

$ grove create feature/auth
Creating worktree for branch "feature/auth" at /home/dev/myapp-auth
   git worktree created
   copied 2 .env file(s)
   symlinked node_modules
   afterCreate done

Worktree "auth" ready (port 3487).
  cd $(grove cd auth)
$ grove list
#  NAME       BRANCH             PATH                    PORT  STATUS
1  main       main               /home/dev/myapp          -     ✓ clean
2  auth       feature/auth       /home/dev/myapp-auth     3487  ✓ clean
3  payments   feature/payments   /home/dev/myapp-payments 3612  2 modified
4  review-42  pr-42-fix-sidebar  /home/dev/myapp-review-42 3721 ✓ clean
$ grove analyze
Project: /home/dev/myapp

Suggested additions:
  + afterCreate "yarn install"
      reason: package.json packageManager=yarn
  + copyDirs ".next/cache"
      reason: next.config.js detected
  + afterCreate "npx husky"
      reason: .husky/_ gitignored (runtime dir)

Apply with: grove analyze --apply
$ grove review 42
Fetching PR #42 "Fix sidebar overflow" by @alice
   fetched via gh
   worktree created
   copied .env files + symlinks + afterCreate done

Worktree "pr-42" ready (port 3721).
  cd $(grove cd pr-42)
binary~6 MB
runtime depsjust git
platformsdarwin · linux
archamd64 · arm64
languageGo
licenseMIT
— 01 · the problem

The part nobody ships.

Worktrees are almost perfect for parallel branches. Almost.

plain git worktree add
  • .env files missing
  • no node_modules, full reinstall
  • cold build cache
  • port 3000 collision
  • setup script not run
  • orphans when you forget
with grove create
  • .env* copied recursively
  • node_modules symlinked
  • .next/dist warm-copied
  • stable port from alias hash
  • afterCreate hook runs
  • state updates locked + atomic in .grove/state.json
— 02 · features

Everything git worktree add should've done.

A dozen behaviors. Together they turn "possible" into "default".

01

Symlinked node_modules

No reinstall per worktree. Root-relative glob patterns such as apps/*/node_modules keep every workspace linked automatically. grove detach breaks the links when branches diverge.

02

Per-worktree ports

Every worktree gets a stable port derived from its alias hash — same alias, same port, every time. Exposed as $GROVE_PORT in your setup script.

Auto .env copy

Walks the project recursively and copies every .env* to the new worktree, preserving directory structure.

Build cache (copyDirs)

Copy .next, dist, or patterns such as packages/*/dist into new worktrees for a warm start. Set copyDirsOnDetach to false when detached branches need clean build artifacts.

PR review

grove review 42 checks out a GitHub PR into a ready-to-run worktree via gh.

afterCreate hooks

One command or an array. Fail-fast, with $GROVE_ALIAS/BRANCH/PORT/PATH in scope.

Orphan handling

grove adopt registers outside worktrees. grove doctor --fix safely repairs only unambiguous local issues.

Merged-branch cleanup

grove prune removes managed worktrees whose branches are already merged, including squash-merged PRs.

Templates

Save any .groverc.json as a reusable template. grove init --template nextjs.

Interactive picker

grove cd with no args opens a fuzzy picker. Tab completion everywhere.

Worktree notes

grove note auth "waiting for review" keeps short local context beside the worktree and shows it in list/status output.

Project detection

grove analyze scans for husky, package managers, Docker Compose, Vite/Remix/SvelteKit, Go, Python, Ruby, PHP, Cargo, Gradle, Next.js, Turbo, and Makefile setup targets — then proposes .groverc.json entries. Same detector runs inside grove init and grove doctor.

Detached worktrees

grove create --detach skips symlinks, can skip incompatible build artifacts with copyDirsOnDetach, and runs afterDetachedCreate for local setup. Later syncs preserve the visible mode; sync --reattach reverses it after local conflicts are resolved.

Agent skill

Ships an embedded skill for agent CLIs. grove skill install autodetects Claude and Codex-style skill dirs so agents route worktree ops through Grove.

— 03 · install

Three ways to plant it.

Single static binary. darwin & linux, amd64 & arm64.

macOS · Linux

Homebrew

recommended
$ brew tap verbaux/tap
$ brew install grove
any Go toolchain

go install

$ go install github.com/verbaux/grove@latest
prebuilt

Binary release

GitHub Releases →
chmod +x, drop in $PATH, done.

— 04 · reference

Commands.

Grouped by when you'd reach for them.

01

Setup

Once per project.

  • grove initInteractive wizard — creates .groverc.json, offers detected conventions as prompts
  • grove analyzeScan project, suggest config additions; --apply, --clean, --dry-run, --yes, --json
  • grove templateSave / list / show / apply / delete reusable configs
  • grove skillInstall, uninstall, or inspect the embedded agent skill in detected Claude / Codex-style skill dirs
  • grove shell-initCompletion + a gcd helper to eval from your shell rc
  • grove completionShell completion for zsh, bash, fish, powershell
02

Daily

The ones you'll alias.

  • grove create <branch>Create worktree + setup; --name, --from, --detach
  • grove cd [name|index]Print path to cd into; fuzzy picker without args
  • grove open [name|index]Open a worktree in your editor; editor config / $EDITOR / --editor
  • grove listTable of worktrees with status, detached mode, port, note, and index; --json, --plain
  • grove psLive running/stopped status for assigned worktree ports; --json
  • grove review [pr]List open PRs or check one out; --name sets the alias
  • grove rename <name|index> <new-alias>Rename a managed worktree; moves standard paths and preserves the assigned port
  • grove note <name|index> [text]Show or set a short local worktree note; --clear removes it
03

Maintenance

When things get messy.

  • grove remove <name|index>Remove a worktree safely; initialized submodule data requires explicit --force
  • grove cleanRemove managed worktrees + orphans without forcing submodule neighbors; --force is explicit
  • grove pruneRemove merged worktrees safely; --base, --yes, explicit --force
  • grove adoptRegister an orphan worktree
  • grove detachRemove symlinks; --copy preserves contents first
  • grove doctorDiagnose config, state, symlinks, ports, deps; --fix safely repairs unambiguous local issues
— 05 · ship it

Tend your branches.
Grove does the rest.

Small Go binary. No runtime dependencies beyond git. MIT-licensed.