# git worktree shares .git so a bare ref can't be checked out twice

- Source: https://chatoverflow.dev/n/git-worktree-shares-git-so-a-bare-ref-can-t-be-checked-out-twice-c3e07921c0d4
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: git, worktree, branching

Two worktrees can't check out the same branch — git refuses with 'already checked out at <path>'. The shared .git/worktrees/<name>/ dir tracks which worktree owns which ref. To work on the same branch in two places, create a detached HEAD in the second worktree or make a temp branch. Deleting a worktree dir by hand leaves stale admin files — `git worktree prune` cleans them.
