threads / bug / 12105

git clone through http bug?

Subject: git clone through http bug?

## tl;dr

3 messages between Feb 14, 2008 and Feb 14, 2008.

replies: 2people: 2as markdown or json

Sergei Organov· Feb 14, 2008, 17:27 UTC · lore
Hello,
I've just cloned the public repo (it's rather small):
$ git clone http://ydirson.free.fr/soft/git/cvsps.git

and it has created cvsps/.git, but no working copy. When I examine the contents, I also notice that while the file .git/HEAD has:

ref: refs/heads/master

there is no .git/refs/heads/master file (the directory .git/refs/heads is empty).

Now, if I first clone the original repository as --bare, and then make a usual local clone from it, the local clone looks file:

$ git clone --bare http://ydirson.free.fr/soft/git/cvsps.git $ git clone cvsps.git cvsps.cloned

Is it a problem with clone over http, a problem with the repository, or it's me who does something wrong?

-- Sergei.
David Symonds· Feb 14, 2008, 17:36 UTC · re: Sergei Organov · lore

Re: git clone through http bug?

On Thu, Feb 14, 2008 at 9:27 AM, Sergei Organov <osv@javad.com> wrote:
Show 7 quoted lines
> Hello,
>
>  I've just cloned the public repo (it's rather small):
>
>  $ git clone http://ydirson.free.fr/soft/git/cvsps.git
>
>  and it has created cvsps/.git, but no working copy.

That's because the remote side doesn't have a HEAD. Just run "git checkout --track -b master origin/master" to create a local branch the tracks the origin/master branch.

Dave.
Sergei Organov· Feb 14, 2008, 18:28 UTC · re: David Symonds · lore

Re: git clone through http bug?

"David Symonds" <dsymonds@gmail.com> writes:
Show 12 quoted lines
> On Thu, Feb 14, 2008 at 9:27 AM, Sergei Organov <osv@javad.com> wrote:
>> Hello,
>>
>>  I've just cloned the public repo (it's rather small):
>>
>>  $ git clone http://ydirson.free.fr/soft/git/cvsps.git
>>
>>  and it has created cvsps/.git, but no working copy.
>
> That's because the remote side doesn't have a HEAD. Just run "git
> checkout --track -b master origin/master" to create a local branch the
> tracks the origin/master branch.
Thanks, that works:

$ git checkout --track -b master origin/master warning: You appear to be on a branch yet to be born. warning: Forcing checkout of origin/master. Already on branch "master" $

Couldn't GIT be more clever and just do this for me? Besides, the fact that it has created HEAD that points nowhere still seems wrong.

-- Sergei.

← back to recent threads