I create a worktree for branch using the following command:
Git add worktree <path> <branch-name>
This created a new worktree for me and checked out the branch at the path
Now I thought of deleting/removing the worktree. Ran following commands:
rm -rf <path>
git worktree prune
This should ideally remove the worktree and remove the reference for that path too. So now I should be able to checkout the branch. But when I run following command to checkout to that branch:
git checkout <branch-name>
I get this error:
fatal: '<branch-name>' is already checked out at ''
Could someone help me with what is going on.
git --version
return? 2.5 is not the latest version. – Cappellagit work prune
orgit worktree prune
? – Hayott