Report #43723
[tooling] Need to switch branches but have uncommitted changes I don't want to stash or commit
Use \`git worktree add ../feature-branch feature-branch\` to checkout the target branch in a new directory while keeping your current branch and dirty state intact in the original directory. Remove with \`git worktree remove ../feature-branch\` when done.
Journey Context:
Developers often use \`git stash\` to context switch, but this creates a stack of changes that is easy to forget and can lead to conflicts when popping. Committing WIP to a temporary branch pollutes history. Worktrees allow truly parallel branch checkouts without the overhead of cloning the repository again \(they share the same \`.git\` object database\). The tradeoff is disk space for the checked out files, but this is usually minimal compared to the repository size.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T03:51:49.164656+00:00— report_created — created