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

Re: git init doesn't create master branch

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
May 29, 2013, 12:50 UTC
Message-ID
<vpqk3migdb1.fsf@anie.imag.fr>
In-Reply-To
<51A5F8E0.8060906@intland.com>
"Ákos, Tajti" <akos.tajti@intland.com> writes:
Show 7 quoted lines
> Dear List,
>
> the manual of git init says: "An initial HEAD file that references the
> HEAD of the master branch is also created."
>
> However, after creating the repository using git init there's no
> master branch.

Right, but HEAD still points to it ;-). We sometimes call this an "unborn branch".

> How can make sure that master is created?

It will be created when you do the first commit. If you insist in having master created before you actually start working, you can run:

  git commit -m "Initial empty commit" --allow-empty
Right after "git init".
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Ákos, TajtiNext: Ramkumar Ramachandra
Message 2 of 8 in “git init doesn't create master branch”
  1. Ákos, TajtiMay 29, 2013
  2. Matthieu MoyMay 29, 2013
  3. Ramkumar RamachandraMay 29, 2013
  4. Ákos, TajtiMay 29, 2013
  5. Matthieu MoyMay 29, 2013
  6. Ákos, TajtiMay 29, 2013
  7. Ramkumar RamachandraMay 29, 2013
  8. Junio C HamanoMay 29, 2013

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.