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

Re: Why can't git open empty branches ?

From
HHHolger Hellmuth <hellmuth@ira.uka.de>
Date
Apr 11, 2012, 14:16 UTC
Message-ID
<4F859245.908@ira.uka.de>
In-Reply-To
<4F856F67.4000609@danisch.de>
Hi Hadmut ;-)
On 11.04.2012 13:47, Hadmut Danisch wrote:
> Creating independent branches by pushing two separates into a single
> remote bare is a nice idea, but if I understood git correctly, the very
> first commit in a repos is always to the master branch, where you have

AFAIK the only thing that makes master the initial branch is the file .git/HEAD that points to master after you "git init". This is not hardcoded.

 > So your proposal might work perfectly, but in my eyes it is error
 > prone and not user friendly.

Serious errors should not happen since the bare repo on the server is created with the flag denyNonFastForwards. So even if you had a master branch in both repos, only one of them, the first one, would succeed in pushing to the server, a push of the second one would give you an error message. Maybe not user friendly, but safe.

Previous: Matthieu Moy
Message 8 of 8 in “Why can't git open empty branches ?”
  1. Hadmut DanischApr 11, 2012
  2. Jonathan NiederApr 11, 2012
  3. Hadmut DanischApr 11, 2012
  4. Matthieu MoyApr 11, 2012
  5. Hadmut DanischApr 11, 2012
  6. Jonathan NiederApr 11, 2012
  7. Matthieu MoyApr 11, 2012
  8. Holger HellmuthApr 11, 2012

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.