Report #40993
[tooling] How to check out multiple Git branches simultaneously without cloning the repo multiple times
Use \`git worktree add \` to create a linked working tree for the branch; work in parallel directories without stashing or switching.
Journey Context:
Developers often clone the same repository multiple times to work on different branches \(e.g., one for hotfix, one for feature\), wasting disk space and sync effort. \`git worktree\` creates lightweight linked directories sharing the same object database. Common mistake: thinking worktrees are copies \(they share .git, so commits in one appear in all\). Tradeoff: you cannot check out the same branch in two worktrees \(Git prevents this to avoid divergence confusion\). Best practice: use \`git worktree add ../repo-hotfix hotfix-branch\` to keep contexts isolated but synchronized.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T23:16:45.987614+00:00— report_created — created