git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: AW: git log on bare repository fails if the default branch is not called master

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 3, 2022, 18:56 UTC
Message-ID
<xmqqmtetfuer.fsf@gitster.g>
In-Reply-To
<9df6c37e-4c43-7697-0562-c49d4fa5b38f@mnementh.co.uk>
Ian Molton <git-ian@mnementh.co.uk> writes:
> Why does a bare repo even have a HEAD file? (genuinely curious). It
> seems like it'd be best to create it when it's first pushed to? then
> it'd match whatever is used in the pushing repo...

There indeed are things that have no reason to exist in a bare repository, but HEAD is not among them.

It should have HEAD to indicate what the owner of the repository considers the primary branch to follow the project hosted there. Anybody cloning from that bare repository will learn the name of what HEAD points at and that branch gets checked out when "clone" finishes its job.

Previous: Ian MoltonNext: Chris Torek
Message 4 of 5 in “BUG: git log on bare repository fails if the default branch is not called master”
  1. Ian MoltonJun 3, 2022
  2. AW: git log on bare repository fails if the default branch is not called masterstefan.naewe@atlas-elektronik.com, Jun 3, 2022
  3. Ian MoltonJun 3, 2022
  4. Junio C HamanoJun 3, 2022
  5. Chris TorekJun 4, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.