git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Luciano Rocha <luciano@eurotux.com>
Cc: git@vger.kernel.org
Subject: Re: commit 0? (or: create new empty branch)
Date: Tue, 11 Mar 2008 14:08:10 +0100	[thread overview]
Message-ID: <47D6843A.1030200@viscovery.net> (raw)
In-Reply-To: <20080311123004.GA27577@bit.office.eurotux.com>

Luciano Rocha schrieb:
> I'd like to create a new branch, without any pre-existing data, for
> purposes similar to git's html/man/.....
> 
> However, I've been unable to do that using the higher level tools.
> 
> Even starting from an empty git rep, I can't create a branch:
> 
> $ git init
> Initialized empty Git repository in .git/
> $ git branch empty
> fatal: Not a valid object name: 'master'.
> 
> How were the different git.git branches created?

There are two ways:

1. Plumbing level

  $ git symbolic-ref HEAD refs/heads/html
  $ rm .git/index
  ...commit new content...

2. Porcelain level

  $ mkdir ../html && cd ../html
  $ git init
  ...commit new content...
  $ cd -   # go back
  $ git fetch ../html master:html

-- Hannes

      parent reply	other threads:[~2008-03-11 13:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-11 12:30 commit 0? (or: create new empty branch) Luciano Rocha
2008-03-11 12:52 ` Johannes Schindelin
2008-03-11 14:45   ` Luciano Rocha
2008-03-11 14:59     ` Johannes Schindelin
2008-03-11 13:08 ` Johannes Sixt [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=47D6843A.1030200@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=git@vger.kernel.org \
    --cc=luciano@eurotux.com \
    /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).