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

Why can't git open empty branches ?

From
HDHadmut Danisch <hadmut@danisch.de>
Date
Apr 11, 2012, 10:35 UTC
Message-ID
<4F855E6B.4010504@danisch.de>
Hi,

when creating a new branch in git, it is by default filled with the contents of the current branch.

Sometimes a new but empty branch is needed. There are plenty of instructions in the web to achieve this with „dirty tricks”, i.e. fiddle around with git's internals. Which is poor design.

Why doesn't git's branch command support opening empty branches in a clean an natural way?

regards Hadmut

Next: Jonathan Nieder
Message 1 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.