git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Stalled git cloning and possible solutions

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 29, 2013, 22:18 UTC
Message-ID
<xmqqvc2o16pn.fsf@gitster.dls.corp.google.com>
In-Reply-To
<201308300305.10440.vkrishn4@gmail.com>
"V.Krishn" <vkrishn4@gmail.com> writes:
Show 21 quoted lines
> On Friday, August 30, 2013 02:40:34 AM you wrote:
>> V.Krishn wrote:
>> > Quite sometimes when cloning a large repo stalls, hitting Ctrl+c cleans
>> > what been downloaded, and process needs re-start.
>> > 
>> > Is there a way to recover or continue from already downloaded files
>> > during cloning ?
>> 
>> No, sadly.  The pack sent for a clone is generated dynamically, so
>> there's no easy way to support the equivalent of an HTTP Range request
>> to resume.  Someone might implement an appropriate protocol extension
>> to tackle this (e.g., peff's seed-with-clone.bundle hack) some day,
>> but for now it doesn't exist.
>
> This is what I tried but then realized something more is needed:
>
> During stalled clone avoid  Ctrl+c. 
> 1. Copy the content .i.e .git folder some other place.
> 2. cd <new dir>
> 3. git config fetch.unpackLimit 999999
> 4. git config transfer.unpackLimit 999999

These two steps will not help, as negotiation between the sender and the receiver is based on the commits that are known to be complete, and an earlier failed "fetch" will not (and should not) update refs on the receiver's side.

>> What you *can* do today is create a bundle from the large repo
>> somewhere with a reliable connection and then grab that using a
>> resumable transport such as HTTP.
Yes.

Another possibility is, if the project being cloned has a tag (or a branch) that points at a commit back when it was smaller, do this

	git init x &&
        cd x &&
        git fetch $that_repository $that_tag:refs/tags/back_then_i_was_small

to prime the object store of a temporary repository 'x' with a hopefully smaller transfer, and then use it as a "--reference" repository to the real clone.

Previous: V.KrishnNext: V.Krishn
Message 4 of 8 in “Stalled git cloning and possible solutions”
  1. V.KrishnAug 29, 2013
  2. Jonathan NiederAug 29, 2013
  3. V.KrishnAug 29, 2013
  4. Junio C HamanoAug 29, 2013
  5. V.KrishnAug 29, 2013
  6. V.KrishnSep 4, 2013
  7. Duy NguyenAug 30, 2013
  8. Duy NguyenAug 30, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.