Using Git Worktrees
Overview
Git worktrees create isolated workspaces that share the same repository, allowing work on multiple branches simultaneously.
Configured strategy: bare_control_siblings
Directory name: ito-worktrees
Default branch: main
Integration mode: commit_pr
Worktree Location
Worktrees live under the bare/control layout:
../
|-- main/
`-- ito-worktrees/<change-name>/
Create a worktree:
mkdir -p "../ito-worktrees"
git worktree add "../ito-worktrees/<change-name>" -b <change-name> main
Always branch new change worktrees from main. Never use the bare/control repo placeholder HEAD as the checkout source.
Do NOT ask the user where to create worktrees.
Path Helpers
If you need absolute paths (for logs, scripts, or agent instructions), use:
ito path project-rootito path worktree-rootito path worktrees-rootito path worktree --main|--branch <name>|--change <id>
Safety Checks
- Ensure the parent directory for the worktree exists (create it if needed).
- Run a clean baseline build/test in the new worktree so new failures are attributable.
- Do not proceed if baseline tests fail without explicitly calling that out.
Cleanup
After the branch is merged:
ito agent instruction finish --change "<branch-name>"
If a worktree is locked, assume it was locked on purpose; do NOT unlock/remove it unless the user explicitly asks.
Integration
Called by:
- Any workflow that needs isolated workspace
Converted and distributed by TomeVault — claim your Tome and manage your conversions.