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

Re: Why can't git open empty branches ?

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Apr 11, 2012, 12:19 UTC
Message-ID
<vpqbomyv4t3.fsf@bauges.imag.fr>
In-Reply-To
<4F856F67.4000609@danisch.de>
Hadmut Danisch <hadmut@danisch.de> writes:
> e.g. open source software and the web pages describing it (like in git
> hub), or a web server tree and the software generating it. They are
> related, but do not logically share a history.

In these cases, you'll want to have two working directories, if only to avoid:

git checkout documentation # fix a typo git commit git checkout code make # complete rebuild triggered.

> 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,

Not necessarily. I don't see an option in "git init" to change the default branch name, but you can

git init foo cd foo git checkout -b whatever-branch-name

and work.

Otherwise, you can have a branch that is locally called "master", and push it as another name (but that is probably the "error prone" in your message ;-) ).

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Jonathan NiederNext: Holger Hellmuth
Message 7 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.