git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Triplett <josh@freedesktop.org>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: "Marijn Schouten (hkBst)" <hkBst@gentoo.org>, git@vger.kernel.org
Subject: Re: cloning empty repo
Date: Wed, 27 Jun 2007 18:32:21 -0700	[thread overview]
Message-ID: <46830FA5.4020203@freedesktop.org> (raw)
In-Reply-To: <20070624230157.GM17393@spearce.org>

Shawn O. Pearce wrote:
> "Marijn Schouten (hkBst)" <hkBst@gentoo.org> wrote:
>> is there any reason why cloning an empty repository should result in an error
>> instead of a succesfully cloned empty repo?
> 
> There's nothing to clone.  The repository is empty.
> 
> If you create a Git repository using `git init` and then create
> another one also using `git init` then both repositories are empty,
> and an empty repository is identical to every other empty repository.
> 
> So if you want to setup an empty repository and then clone nothing,
> you actually can just setup another empty repository and configure
> the 'origin' remote:
> 
> 	mkdir a; cd a; git init; cd ..
> 
> 	mkdir b; cd b; git init
> 	# now a and b are identical
> 
> 	git remote add origin ../a/.git
> 	# now b is a "clone" of a's nothingness...

You can also simulate a clone of any other repository by using a similar
series of commands; git clone exists so that you don't have to.  Why not allow
cloning an empty repository, which would give you an empty repository with the
correct origin remote?

- Josh Triplett

      reply	other threads:[~2007-06-28  1:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-24 15:04 cloning empty repo Marijn Schouten (hkBst)
2007-06-24 23:01 ` Shawn O. Pearce
2007-06-28  1:32   ` Josh Triplett [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=46830FA5.4020203@freedesktop.org \
    --to=josh@freedesktop.org \
    --cc=git@vger.kernel.org \
    --cc=hkBst@gentoo.org \
    --cc=spearce@spearce.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).