'' is already checked out at '' in git worktrees

后端 未结 6 777
被撕碎了的回忆
被撕碎了的回忆 2020-12-14 15:31

I started using git worktrees. It seems to work, but I\'m getting this error when attempting to check out a branch in the cloned worktree:

fatal: \'

        
6条回答
  •  攒了一身酷
    2020-12-14 16:20

    Git won't let you check out the same branch twice, because if you do, and then go to one of the two work-trees and make a new commit, you'll set yourself up for misery when you go back to the other work-tree.

    If you have actually removed the other work-tree, simply run git worktree prune to make Git realize this. If you have not actually removed the other work-tree, don't check it out twice: it's no fun.

提交回复
热议问题