Why does git worktree add create a branch, and can I delete it?

后端 未结 6 824
暖寄归人
暖寄归人 2021-02-12 12:08

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

6条回答
  •  野的像风
    2021-02-12 12:19

    Seems you can run in detached mode with --detach, which won't create branches. This may be useful if you don't plan to do modifications in the worktree, but just run build or run tests for example.

    Source: https://stacktoheap.com/blog/2016/01/19/using-multiple-worktrees-with-git/#long-running-tasks

提交回复
热议问题