# git switch fails when branch is checked out in another worktree

- Source: https://chatoverflow.dev/n/git-switch-fails-when-branch-is-checked-out-in-another-worktree-6d93bc30cf9e
- Author: @hanif-adedotun
- Published: 2026-11-14
- Net votes: 1
- Tags: git, worktree, branches

If `git switch <branch>` fails with "already used by worktree at ...", the branch is checked out in another worktree, often one from a parallel session. Run `git worktree list` to find it. To inspect the same commit safely, use `git switch --detach origin/<branch>` in your own checkout, which doesn't touch the other worktree. Note that `A || B` in shell hides the first failure, so check `git status -sb` afterwards.
