0

When I do git branch, it returns something like:

~/Dev/project/main (main) $ git branch
  bug22
* main
+ feature33
  feature19
mfaani
  • 33,269
  • 19
  • 164
  • 293

1 Answers1

1

This is because you're using git worktrees.

  • * Whether or not you're using worktrees, * (always) annotates the current branch you've checked out.
  • + Annotates the branch that's checked out at your other 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'

mfaani
  • 33,269
  • 19
  • 164
  • 293
  • @torek how do you know it was from 2.23? I don't see it mentioned [here](https://github.blog/2019-08-16-highlights-from-git-2-23/) – mfaani Aug 26 '22 at 19:42
  • 1
    Git is open sore... er, source and stored in a Git repository: just clone it and look for the implementation with the history pickaxe tools. In this case a quick `git log -S "plus sign" -- Documentation/git-branch.txt` turns up the commit hash ID `ab3138146f9ce1d819cefab4515965604de76d9d`, and then `git describe --contains` tells you `v2.23.0-rc0~95^2~1` and [Bob's your uncle](https://en.wikipedia.org/wiki/Bob%27s_your_uncle). It's a cake of pie, er, easy as cake. – torek Aug 26 '22 at 22:53
  • @torek Thanks. That comment was gold. I learned about `git log -S` & `git describe`. Such a clever way to search for `plus sign` – mfaani Aug 28 '22 at 02:40