Report #5562
[tooling] Switching branches requires stashing changes or creating messy WIP commits, blocking parallel work on multiple branches
Use git worktree add ../repo-branch-name branch-name to check out a branch in a separate directory with its own working tree, allowing simultaneous development on main, features, and hotfixes without git state pollution
Journey Context:
Developers traditionally context-switch by stashing \(losing stack context\) or committing WIP code \(polluting history\). Worktrees create truly independent directories per branch, each with its own index and tracked files, referencing the same object store. This allows running tests on main while editing a feature branch, or reviewing a PR while continuing development, without the O\(n\) cost of git checkout switching. Crucial for agents that need to read source from one branch while writing to another.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T21:40:01.033723+00:00— report_created — created