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

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

From
stefan.naewe@atlas-elektronik.com <stefan.naewe@atlas-elektronik.com>
Date
Jun 3, 2022, 14:40 UTC
Message-ID
<48bcd99afbca4c73b938c3ed4e104c64@atlas-elektronik.com>
In-Reply-To
<a1830e79-9503-3fd9-8c50-a2856206e219@mnementh.co.uk>
Show 30 quoted lines
> -----Ursprüngliche Nachricht-----
> Von: Ian Molton <git-ian@mnementh.co.uk>
> Gesendet: Freitag, 3. Juni 2022 16:22
> An: git@vger.kernel.org
> Cc: Ian Molton <git-ian@mnementh.co.uk>
> Betreff: BUG: git log on bare repository fails if the default branch is not called
> master
> 
> Hi,
> 
> Please CC me in replies, I'm not on the list.
> 
> I've noticed that git log assumes the default branch is master, even if it doesn't
> exist...
> 
> My latest repo has it set to "mainline" and all was well until I pushed it to a bare
> repo on my server.
> 
> Expectation:
> 
> If I run
> 
> git log
> 
> in the bare repo, it should log the default (or only!) branch.
> 
> Reality:
> 
> git log
> # fatal: your current branch 'master' does not have any commits yet
I bet the HEAD file in your bare repository points to refs/heads/master...
Stefan
Previous: Ian MoltonNext: Ian Molton
Message 2 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.