# Failure cloning from a separate-git-dir repository

6 messages from 2011-08-20 to 2011-08-21. Participants: Richard Tibbitt, Nguyen Thai Ngoc Duy, Junio C Hamano.
Thread: https://gitlist.dev/t/28175

## Richard Tibbitt, 2011-08-20 17:47

Subject: Failure cloning from a separate-git-dir repository
Message-ID: <6csv47te4qv41ni53q0kf1fne0a4e1grnm@4ax.com>
URL: https://gitlist.dev/e/6csv47te4qv41ni53q0kf1fne0a4e1grnm%404ax.com

```
Hi

I've been struggling to find an answer to this for days.

Can anyone confirm whether I've got the syntax right for 'Git clone'
when attempting to clone FROM a repository that was initialized using
--separate-git-dir ?

If so, does this work on Linux systems ?

With Git on windows (git version 1.7.6.msysgit.0 installed from
GitExtensions224SetupComplete.msi) I get an error as below, that looks
as though 'Git clone' is expecting the repo to have a 'normal'
integral .git dir 


  F:\>mkdir repo2
  F:\>mkdir repo2git
  F:\>cd repo2
  F:\repo2>call git init --separate-git-dir="..\repo2git\.git"
  Initialized empty Git repository in F:/repo2git/.git/
  F:\repo2>echo abc >file1.txt
  F:\repo2>call git add . -A
  F:\repo2>call git commit -m "first"
  [master (root-commit) c7e4766] first
   1 files changed, 1 insertions(+), 0 deletions(-)
   create mode 100644 file1.txt
  F:\repo2>cd ..
  F:\>call git clone repo2 clone2
  Cloning into clone2...
  fatal: failed to open 'F:/repo2/objects': No such file or directory


Many thanks in advance for any insight into this.

Richard

```

## Nguyen Thai Ngoc Duy, 2011-08-20 18:25

Subject: Re: Failure cloning from a separate-git-dir repository
Message-ID: <CACsJy8AavETJb-Lm0Qd6Sz54zYbgvDUWmf+uXYTxO3+iYNHvoA@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8AavETJb-Lm0Qd6Sz54zYbgvDUWmf%2BuXYTxO3%2BiYNHvoA%40mail.gmail.com
In-Reply-To: <6csv47te4qv41ni53q0kf1fne0a4e1grnm@4ax.com>

```
On Sun, Aug 21, 2011 at 12:47 AM, Richard Tibbitt <gitlist@lazyprune.com> wrote:
>  F:\>call git clone repo2 clone2
>  Cloning into clone2...
>  fatal: failed to open 'F:/repo2/objects': No such file or directory

This should be "git clone repo2/.git clone2", but with that command I got

Cloning into clone2..
error: '/tmp/repo2/.git' does not look like a v2 bundle file
fatal: Could not read bundle '/tmp/repo2/.git'.

You just do "git clone repo2git/.git clone2" for now.
-- 
Duy

```

## Richard Tibbitt, 2011-08-20 18:56

Subject: Re: Failure cloning from a separate-git-dir repository
Message-ID: <p800579qgdoocnq388veh5gpjbu7r9ph52@4ax.com>
URL: https://gitlist.dev/e/p800579qgdoocnq388veh5gpjbu7r9ph52%404ax.com
In-Reply-To: <CACsJy8AavETJb-Lm0Qd6Sz54zYbgvDUWmf+uXYTxO3+iYNHvoA@mail.gmail.com>

```
On Sun, 21 Aug 2011 01:25:36 +0700, Nguyen Thai Ngoc Duy wrote:

>This should be "git clone repo2/.git clone2", but with that command I got
>
>Cloning into clone2..
>error: '/tmp/repo2/.git' does not look like a v2 bundle file
>fatal: Could not read bundle '/tmp/repo2/.git'.
>
>You just do "git clone repo2git/.git clone2" for now.

Hi - thanks for trying that

Unfortunately I'm getting :-

call git clone repo2git\.git clone2
fatal: repository 'repo2git\.git' does not exist

& similarly

call git clone repo2\.git clone2
fatal: repository 'repo2\.git' does not exist

I guess this must be a peculiarity of msysgit on windows.

```

## Nguyen Thai Ngoc Duy, 2011-08-21 03:27

Subject: Re: Failure cloning from a separate-git-dir repository
Message-ID: <CACsJy8A4kvjn5Bgo6FtS+x4z=CRz8ctoDHh7D8XV3frOjDVfbw@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8A4kvjn5Bgo6FtS%2Bx4z%3DCRz8ctoDHh7D8XV3frOjDVfbw%40mail.gmail.com
In-Reply-To: <p800579qgdoocnq388veh5gpjbu7r9ph52@4ax.com>

```
On Sun, Aug 21, 2011 at 1:56 AM, Richard Tibbitt <gitlist@lazyprune.com> wrote:
> call git clone repo2git\.git clone2
> fatal: repository 'repo2git\.git' does not exist
>
> I guess this must be a peculiarity of msysgit on windows.

Yes. Try "call git clone repo2git/.git clone2" (forward slash). The
forward slash is hard coded some places in git-clone. I just want to
make sure you dont hit another problem.
-- 
Duy

```

## Richard Tibbitt, 2011-08-21 11:13

Subject: Re: Failure cloning from a separate-git-dir repository
Message-ID: <upp157hv6v33nlfpsoeh68kqc7fvpdv7ig@4ax.com>
URL: https://gitlist.dev/e/upp157hv6v33nlfpsoeh68kqc7fvpdv7ig%404ax.com
In-Reply-To: <CACsJy8A4kvjn5Bgo6FtS+x4z=CRz8ctoDHh7D8XV3frOjDVfbw@mail.gmail.com>

```
On Sun, 21 Aug 2011 10:27:44 +0700, Nguyen Thai Ngoc Duy wrote:

>Yes. Try "call git clone repo2git/.git clone2" (forward slash). The
>forward slash is hard coded some places in git-clone. I just want to
>make sure you dont hit another problem.

Thanks for that - same result sadly.

I'll see what the guys on the msysgit list say about it.

Richard

```

## Junio C Hamano, 2011-08-21 18:51

Subject: Re: Failure cloning from a separate-git-dir repository
Message-ID: <7vippqy4w0.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vippqy4w0.fsf%40alter.siamese.dyndns.org
In-Reply-To: <CACsJy8A4kvjn5Bgo6FtS+x4z=CRz8ctoDHh7D8XV3frOjDVfbw@mail.gmail.com>

```
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:

> On Sun, Aug 21, 2011 at 1:56 AM, Richard Tibbitt <gitlist@lazyprune.com> wrote:
>> call git clone repo2git\.git clone2
>> fatal: repository 'repo2git\.git' does not exist
>>
>> I guess this must be a peculiarity of msysgit on windows.
>
> Yes. Try "call git clone repo2git/.git clone2" (forward slash). The
> forward slash is hard coded some places in git-clone. I just want to
> make sure you dont hit another problem.

As "fetch from bundle" (2e0afaf (Add git-bundle: move objects and
references by archive, 2007-02-22)) predates the "gitdir:" support
(b44ebb1 (Add platform-independent .git "symlink", 2008-02-20)) by a wide
margin, I wouldn't be surprised at all if the logic went "If the name can
be stat()ed and is a regular file, it must be a bundle. Otherwise it is a
local clone if it is a directory. All else ask the transport and see what
it says".

Why can't it be "git clone repo2git clone2" in the first place?

```
