threads / discuss / 38128

How to repair a shallow clone (?)

Subject: How to repair a shallow clone (?)

## tl;dr

5 messages between Dec 6, 2014 and Dec 7, 2014.

replies: 4people: 4as markdown or json

Torsten Bögershausen· Dec 6, 2014, 12:23 UTC · lore

I share a bare repo with Sparkleshare which does an auto-synch. Now the synch had stopped, and trying to push to the central repo by hand gives this:

git push origin master fatal: protocol error: expected old/new/ref, got 'shallow 72fb4080921221293e28a97a0e8c78d6100c5186' fatal: The remote end hung up unexpectedly Counting objects: 4, done. Delta compression using up to 2 threads. Compressing objects: 100% (4/4), done. error: pack-objects died of signal 13 error: failed to push some refs to xxxxx

Both machines have Git >2.0.0
Is this a known issue/problem ?

I think I started to clone the repo in a shallow way (SparkleShare asked if I want to clone the complete history, and I probably answered "no" )

Is there a way to repair this situation ? (Except doing a complete re-clone ?)

Thanks for help
Trần Ngọc Quân· Dec 7, 2014, 00:37 UTC · re: Torsten Bögershausen · lore

Re: How to repair a shallow clone (?)

On 06/12/2014 19:23, Torsten Bögershausen wrote:
Show 7 quoted lines
> I think I started to clone the repo in a shallow way
> (SparkleShare asked if I want to clone the complete history,
> and I probably answered "no" )
>
> Is there a way to repair this situation ?
> (Except doing a complete re-clone ?)
>

I think git don't accept push from shallow repo. I've ever encounter this problem. I UNshallow it, then every thing will work:

$ git fetch --unshallow origin

This command will convert a shallow repository to a complete one. See git-fetch(1) and git-clone(1).

I hope it helpful! Thanks,

-- 
Trần Ngọc Quân.
Philip Oakley· Dec 7, 2014, 10:47 UTC · re: Trần Ngọc Quân · lore

Re: How to repair a shallow clone (?)

From: "Trần Ngọc Quân" <vnwildman@gmail.com>
Show 16 quoted lines
> On 06/12/2014 19:23, Torsten Bögershausen wrote:
>> I think I started to clone the repo in a shallow way
>> (SparkleShare asked if I want to clone the complete history,
>> and I probably answered "no" )
>>
>> Is there a way to repair this situation ?
>> (Except doing a complete re-clone ?)
>>
> I think git don't accept push from shallow repo. I've ever encounter
> this problem. I UNshallow it, then every thing will work:
>
> $ git fetch --unshallow origin
>
> This command will convert a shallow repository to a complete one.
> See git-fetch(1) and git-clone(1).
>

Since v1.9.0 (14 Feb '14.) you can do various push/pull from a shallow clone (I'd asked this way back http://stackoverflow.com/questions/6900103/why-cant-i-push-from-a-shallow-clone and noted when it was corrected/improved)

That's not to say that you don't have to take care about your local depth being sufficiently inclusive.

I'm sure that sometime a --timedepth=<time_t time> will eventually be coded by someone sufficiently in need. ;-)

-- Philip

Duy Nguyen· Dec 7, 2014, 11:44 UTC · re: Torsten Bögershausen · lore

Re: How to repair a shallow clone (?)

On Sat, Dec 6, 2014 at 7:23 PM, Torsten Bögershausen <tboegi@web.de> wrote:
Show 16 quoted lines
> I share a bare repo with Sparkleshare which does an auto-synch.
> Now the synch had stopped, and trying to push to the central repo
> by hand gives this:
>
>
>
> git push  origin master
> fatal: protocol error: expected old/new/ref, got 'shallow 72fb4080921221293e28a97a0e8c78d6100c5186'
> fatal: The remote end hung up unexpectedly
> Counting objects: 4, done.
> Delta compression using up to 2 threads.
> Compressing objects: 100% (4/4), done.
> error: pack-objects died of signal 13
> error: failed to push some refs to xxxxx
>
> Both machines have Git >2.0.0
Please try again with $GIT_TRACE_PACKET=/some-log-file. receive-pack
>2.0 should recognize this shallow line.
> Is this a known issue/problem ?
No.
-- 
Duy
Torsten Bögershausen· Dec 7, 2014, 17:53 UTC · re: Duy Nguyen · lore

Re: How to repair a shallow clone (?)

On 2014-12-07 12.44, Duy Nguyen wrote:
>> Is this a known issue/problem ?
> 
> No.
> 
Thanks everybody for the support.
The machine was equipped with git version 1.7.10.4 in /usr/bin.

I installed 2.1 or so under /usr/local/bin, (and even /root/bin) thinking that this would help, but it didn't.

Because the login shell for the user "storage" which manages the push/pull on the server side was /usr/bin/git-shell, not /usr/local/bin/git-shell.

← back to recent threads