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.

  • What is the difference between these `git fetch` syntaxes?
  • git command for making one branch like another
  • Can multiple Git clients be used on the same repository?
  • Git-tfs trying to pull from old tfs server instead of our new one
  • How to properly use CI scripts with Git hooks to compress source
  • Prune empty merge commits from history in Git repository
  • Commit and push a Git repository using Rails
  • Merge-only Branch on BitBucket/GitLab/GitHub?
  • Change configuration on azure website when using GIT to deploy
  • How to merge head commits from another branch?
  • How to move Egit repository and working directory
  • Git push upstream
  • 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.