Report #82074
[tooling] Switching Git branches destroys WIP or requires constant stashing
Clone a bare repository with \`git clone --bare .bare && echo 'gitdir: ./.bare' > .git\`, then add worktrees for each branch: \`git worktree add -b feature ../feature-branch\`. This keeps branches in isolated directories with a shared object database.
Journey Context:
Developers often stash changes or commit WIP to switch contexts, which risks losing work or polluting history. Worktrees allow simultaneous checkouts, but using them with normal clones creates confusion about which directory is the 'real' repo. The bare-clone pattern eliminates the 'main' working directory entirely, reducing disk usage through shared object storage and making branch isolation explicit.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T20:21:24.613237+00:00— report_created — created