why does bare repository have HEAD
I’m wondering what’s the purpose of
HEAD in bare repository? Is it just used when repository is cloned to know which branch to checkout in cloned repository?
Please note, this question is not about
what is HEAD, but given its functions I’m wondering why it’s needed inside
One Solution collect form web for “why does bare repository have HEAD”
Can you please name a case where HEAD is used in a bare repository?
You can do a soft reset in a bare repo, which means you can move HEAD (current commit) around, which is one way to change the default branch.
That means that when you clone a bare repo, the default branch checked out in the non-bare clone will be the one referenced by the bare repo HEAD.