Report #41564
[tooling] Git: need to work on multiple branches simultaneously \(e.g., hotfix vs feature\) but cloning the repo multiple times wastes disk space and requires syncing remotes
Use \`git worktree add \` to create linked working trees; enable \`git config extensions.worktreeConfig true\` to allow per-worktree git config \(e.g., different user.email for work vs personal\)
Journey Context:
Developers often clone a repository twice to have 'main' and 'feature' checked out simultaneously, doubling disk usage \(especially for large repos like Chromium or Unreal\) and requiring manual remote updates. git worktree creates lightweight pointer directories sharing the same object database but with independent HEADs and indices. This allows running tests on 'main' while editing 'feature' without stashing. The worktreeConfig extension \(Git 2.35\+\) solves the limitation where .git/config is global to all worktrees: by setting extensions.worktreeConfig=true, Git reads .git/worktrees//config for worktree-specific settings. This is critical for switching contexts like 'git config --worktree user.name' for corporate vs open-source contributions in the same repo. Common pitfalls: worktrees must be on the same filesystem \(hardlinks\), and 'git worktree prune' cleans up stale administrative files.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T00:14:15.343128+00:00— report_created — created