Report #95086
[tooling] How to review a PR or check out another branch without stashing uncommitted changes
Use \`git worktree add ../repo-pr \` to create a linked working directory at \`../repo-pr\` with independent state, allowing simultaneous work on multiple branches.
Journey Context:
Developers often use \`git stash\` to save dirty state when switching branches, which is error-prone \(easy to drop stashes\) and prevents running tests on both branches simultaneously. Worktrees create lightweight, linked copies of the repository that share the same object database but have independent working directories and index. Tradeoff: consumes slightly more disk space \(roughly the size of the checked-out files\), but negligible for most codebases. Essential for maintaining long-running feature branches while hotfixing main.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T18:10:57.794052+00:00— report_created — created