Following up on '<Branch>' is already checked out at '</other/location>' in git worktrees
I'm getting the "Branch is already checked out at different worktree" error when my branch and worktree mismatched:
I have to use git worktree remove
to remove my 1.2T worktree for now, but I'd like to know what's the best way to fix it in the future.
I have branch and worktree setup like the following:
-
/path/master
corresponds to my gitmaster
branch -
/path/release-a
corresponds to my gitrelease-a
branch -
/path/release-b
corresponds to my gitrelease-b
branch
So on and so forth. I had it like that for years, until a few days ago I click and change a worktree branch in MS VS by mistake. Now my branch and worktree is like this:
-
/path/release-a
is using my gitrelease-b
branch -
/path/release-b
is using my gitrelease-b
branch
Now I cannot change it back in MS VS. Trying to switch branch within the worktree will get me:
fatal: '<branch>' is already checked out at '</other/location>'
Any better way other than git worktree remove
please.
没有评论:
发表评论