I used git worktree add
to create a new worktree. I noticed that is has created a new branch in the repo with the same name as the worktree. What is this branch for
As the other guys answer this question, I put commands to delete the folder
, delete worktree
and delete branch
here:
first, list all of your worktrees to double check...
$ git worktree list
then, delete the folder of the worktree
$ rm -rf path/to/worktree
after that, delete the worktree itself
$ git worktree prune
in case you have more than one worktree, the above command only prune the worktree that its path doesn't exist anymore, so don't worry!
finally, delete the branch (same branch-name as the worktree)
$ git branch -D