Re: Cloning empty repositories, was Re: What is the idea for bare repositories?
- From
Matthieu Moy <matthieu.moy@imag.fr>
- Date
- Nov 13, 2007, 09:48 UTC
- Message-ID
- <vpqzlxiiii6.fsf@bauges.imag.fr>
- In-Reply-To
- <7v4pfr2kmh.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> But both of Johannes's points apply equally well to an empty > bare repository and to an empty non bare repository. IOW, > bareness does not matter to the suggestion Johannes gave.
He was suggesting to create the initial commit before cloning:
>> So you need to populate the repository before starting _anyway_.
To create an initial commit in a non-bare repository, I put files in it, git add, and git commit.
To create an initial commit in a bare repository, the most natural way for me is to clone it, create the commit in the clone, and then push.
Bare-ness _does_ matter for that.
I repeat the use-case I mentionned above :
,---- | a typical use-case is when I want to create a new project. I'd | like to initialize an empty bare repo on my backed up disk, and then | clone it to my local-fast-unreliable disk to get a working copy and do | the first commit there. `----
I find this quite natural, and up to now, no one gave me either a rationale not to do that, or a _simple_ way to achieve this. As I said, it's currently not _very_ hard to do, but I have to edit .git/config by hand, while git clone knows how to do this much faster than I for non-empty repositories.
-- Matthieu