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 bare repository.

  • Single-developer Git with Dropbox backups: seeking safe, simple configuration
  • git svn dcommit without rebasing
  • TortoiseGIT + Gitolite 3
  • Git cherry pick and datamodel integrity
  • Merging two git repositories as different versions
  • error: git-upload-pack died of signal 13
  • Rebasing pushed commits if only on personal branch
  • What does the double-dash option do on git reset?
  • Using a single git repository for multiple git projects
  • Repairing a git repository after blindly using sed on all files
  • Jenkins Git plugin with https
  • Best Practice for Adding .gitignore to Repo
  • 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?

    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.

    Git Baby is a git and github fan, let's start git clone.