Why can two git worktrees not check out the same branch?
问题 Using a separate git-worktree, why can I not check out the same branch as in the main working copy? If I try, I get the error: fatal: 'mybranch' is already checked out at '/path/to/repo' I can see that if I check in from one worktree, the other would end up in a detached HEAD state, but is that so bad, and why can I not even check out the same branch? 回答1: I can see that if I check in from one worktree, the other would end up in a detached HEAD state Actually, it wouldn't , and that's the