Report #4890
[tooling] Context switching between feature branches requires stashing or committing WIP changes, polluting history
Use \`git worktree add -b \` to create a new branch in a separate directory while keeping the current worktree intact; this allows simultaneous work on multiple branches without stashing.
Journey Context:
Developers often need to switch contexts \(e.g., urgent bugfix while deep in a feature\). Traditional approaches—\`git stash\` or committing WIP—risk losing context or creating 'fixup' commits that require later cleanup. \`git worktree\` allows checking out multiple branches into separate filesystem directories simultaneously. The \`-b\` flag creates a new branch at the specified \`\` \(often \`main\` or \`HEAD~3\`\) in the new worktree. This maintains clean history, avoids stashing, and enables parallel workflows \(e.g., running tests on \`main\` while editing a feature\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T20:14:45.766074+00:00— report_created — created