79546515

Date: 2025-03-31 14:41:26
Score: 1
Natty:
Report link

It looks like as of git version 2.39.5*, you can just do this:

git branch --show-current

Assuming someone has a relatively recent version of git, am I missing a reason not to just do that? It seems a lot simpler than some of the other answers, though I certainly appreciate the creativity that's gone into some of them.

*Probably some earlier versions as well. I've just been too lazy to check.

Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Duke of the Trash Heap