Skip to content

wtm relocate

This content is for v0.28. Switch to the latest version for up-to-date documentation.

Move worktrees to align with base_path and adopt external ones

Reconcile every worktree with the configured base_path. Worktrees not under it are moved (git worktree move) and worktrees created outside wtm are adopted (their parent recorded so wtm sync works). Pass --to to change base_path and move existing worktrees to the new location. Dirty or locked worktrees are skipped unless --force; an occupied target path is never overwritten, and a worktree whose jobs are running is never moved (stop them with wtm run down <branch> first). Adoption keeps what the worktree's meta.json already records (isolation, namespaces, ordinal).

wtm relocate [flags]
# Show the plan first
wtm relocate --dry-run
wtm relocate
# Move every worktree under a new directory
wtm relocate --to ../acme.trees --yes
--dry-run Preview the plan without moving or adopting anything
--force Lift safety refusals (dirty/locked): move those worktrees too; still asks to confirm unless --yes
-h, --help help for relocate
--output string Output format: text or json (default "text")
--to string New base_path (relative to repo root); also moves existing worktrees there
-y, --yes Skip all prompts; resolve every decision from flags and safe defaults (parents default to the base branch)
-q, --quiet Silence human output; errors and the exit code are unaffected, and --output json still emits its document
  • wtm - Orchestrate git worktrees and team dev workflows from the terminal