gitgit-worktree

Why does `git branch` annotate a branch with `+` and another with `*`?


When I do git branch, it returns something like:

~/Dev/project/main (main) $ git branch
  bug22
* main
+ feature33
  feature19

Solution

  • This is because you're using git worktrees.

    like if I tried checking out feature33 then I would have got the following error:

    fatal: 'feature33' is already checked out at '~/Dev/project/features'