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 bare
repository.
Can you please name a case where HEAD is used in a bare repository?
See "t/t1430-bad-ref-name.sh
"
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With