git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Guido Ostkamp <git@ostkamp.fastmail.fm>
Cc: git@vger.kernel.org
Subject: Re: Git branch bug
Date: Sat, 5 May 2007 19:54:20 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0705051954130.4015@racer.site> (raw)
In-Reply-To: <Pine.LNX.4.64.0705051942550.14963@bianca.dialin.t-online.de>

Hi,

On Sat, 5 May 2007, Guido Ostkamp wrote:

> > On Sat, 5 May 2007, Guido Ostkamp wrote:
> > 
> > > $ mkdir test
> > > $ cd test
> > > $ git init
> > > Initialized empty Git repository in .git/
> > > $ git branch experimental
> > > fatal: Not a valid object name: 'master'.
> > > 
> > > So, it seems it is not possible to create a named branch on an empty
> > > repository.
> > 
> > Actually, it is not possible to branch from a non-existing branch. So,
> > this is somewhat expected from my POV.
> 
> From a git beginners point of view, I would expect that the 'master' 
> branch is automatically created when performing the 'git init'. Why is 
> this not the case?

Well, one side of the branch _is_ created. But you have to provide initial 
content, to make it a proper branch, from which you can actually branch 
off.

Having said that, and having read Daniels mail, I agree that this 
behaviour should be changed, along with the behaviour of "git checkout -b 
<branch>" in a fresh repo.

It might be the illogical thing, to allow branching of a 
yet-to-be-initialised branch, but it does not hurt either.

Ciao,
Dscho

      reply	other threads:[~2007-05-05 17:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-05 16:24 Git branch bug Guido Ostkamp
2007-05-05 16:42 ` Johannes Schindelin
2007-05-05 17:05   ` Daniel Barkalow
2007-05-06  6:30     ` Junio C Hamano
2007-05-06 16:16       ` Daniel Barkalow
2007-05-05 17:44   ` Guido Ostkamp
2007-05-05 17:54     ` Johannes Schindelin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0705051954130.4015@racer.site \
    --to=johannes.schindelin@gmx.de \
    --cc=git@ostkamp.fastmail.fm \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).