Report #12546
[tooling] Switching branches with uncommitted changes requires stashing or committing work in progress
Use git worktree add ../ to create a new directory for that branch without disturbing the current working tree
Journey Context:
Stashing is destructive and context-switching loses IDE state. Worktrees allow simultaneous checkouts \(e.g., main vs feature\) with independent .git tracking via .git files pointing back to the main objects database. This enables running tests on main while editing the feature branch, or quick hotfixes without stashing. Unlike cloning the repo again, worktrees share the object database, saving disk space. Common mistake: creating worktrees inside the current working tree \(creates nested git confusion\); always use sibling directories.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T16:17:37.429804+00:00— report_created — created