From: Matthieu Moy Date: Tue, 13 Nov 2007 22:01:00 GMT Subject: Re: Cloning empty repositories, was Re: What is the idea for bare repositories? Message-ID: In-Reply-To: <7vir46t2cc.fsf@gitster.siamese.dyndns.org> Junio C Hamano writes: > Matthieu Moy writes: > >> 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. > > You are still wrong. > > The most natural is to create a commit in a non-bare repository > you create, and push into a bare empty repository. Yes, we agree on that point. But I do find (incorrect with current git) (1) $ mkdir ~/bare-repo $ cd ~/bare-repo $ git --bare init $ cd $ git clone bare-repo local/non-bare $ cd local/non-bare $ git push Simpler than (valid with current git) (2) $ mkdir ~/bare-repo $ cd ~/bare-repo $ git --bare init $ cd $ mkdir local/non-bare $ cd local/non-bare $ git init $ git push ~/bare-repo $ git remote add origin ~/bare-repo $ git config branch.master.remote origin $ git config branch.master.merge refs/heads/master Where the bare-ness of ~/bare-repo matters is that with a bare repository, I could have actually created the initial commit there (valid with current git too): (3) $ mkdir ~/non-bare-repo $ cd ~/non-bare-repo $ git init $ cd $ git clone bare-repo local/non-bare > The repository that is pushed into can be non-bare, but bareness of > that does _NOT_ matter. Either there is a way to achive (3) above with a bare repository which I don't know, or bare-ness does matter in this case. -- Matthieu