# How to repair a shallow clone (?)

5 messages from 2014-12-06 to 2014-12-07. Participants: Torsten Bögershausen, Trần Ngọc Quân, Philip Oakley, Duy Nguyen.
Thread: https://gitlist.dev/t/38128

## Torsten Bögershausen, 2014-12-06 12:23

Subject: How to repair a shallow clone (?)
Message-ID: <5482F55F.1060008@web.de>
URL: https://gitlist.dev/e/5482F55F.1060008%40web.de

```
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, 2014-12-07 00:37

Subject: Re: How to repair a shallow clone (?)
Message-ID: <5483A166.4010109@gmail.com>
URL: https://gitlist.dev/e/5483A166.4010109%40gmail.com
In-Reply-To: <5482F55F.1060008@web.de>

```
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).

I hope it helpful!
Thanks,

-- 
Trần Ngọc Quân.

```

## Philip Oakley, 2014-12-07 10:47

Subject: Re: How to repair a shallow clone (?)
Message-ID: <C4634931164E4141BEC9D1395D80CF9B@PhilipOakley>
URL: https://gitlist.dev/e/C4634931164E4141BEC9D1395D80CF9B%40PhilipOakley
In-Reply-To: <5483A166.4010109@gmail.com>

```
From: "Trần Ngọc Quân" <vnwildman@gmail.com>
> 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, 2014-12-07 11:44

Subject: Re: How to repair a shallow clone (?)
Message-ID: <CACsJy8DshPJreCDOUYWO90E9jsDVe8XO_jVjMCcC=DV8EK6N5Q@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8DshPJreCDOUYWO90E9jsDVe8XO_jVjMCcC%3DDV8EK6N5Q%40mail.gmail.com
In-Reply-To: <5482F55F.1060008@web.de>

```
On Sat, Dec 6, 2014 at 7:23 PM, Torsten Bögershausen <tboegi@web.de> wrote:
> 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, 2014-12-07 17:53

Subject: Re: How to repair a shallow clone (?)
Message-ID: <5484941A.4040300@web.de>
URL: https://gitlist.dev/e/5484941A.4040300%40web.de
In-Reply-To: <CACsJy8DshPJreCDOUYWO90E9jsDVe8XO_jVjMCcC=DV8EK6N5Q@mail.gmail.com>

```
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.

```
