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

Re: How to resume broke clone ?

From
Jeff King <peff@peff.net>
Date
Nov 28, 2013, 09:12 UTC
Message-ID
<20131128091258.GB11444@sigill.intra.peff.net>
In-Reply-To
<20131128013236.96eec638b311907e2368f42b42021fd8.17478ad17f.wbe@email02.secureserver.net>
On Thu, Nov 28, 2013 at 01:32:36AM -0700, Max Kirillov wrote:
Show 19 quoted lines
> > git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> > 
> > I am in china. our bandwidth is very limitation. Less than 50Kb/s.
> 
> You could manually download big packed bundled from some http remote.
> For example http://repo.or.cz/r/linux.git
> 
> * create a new repository, add the remote there.
> 
> * download files with wget or whatever:
>  http://repo.or.cz/r/linux.git/objects/info/packs
> also files mentioned in the file. Currently they are:
>  http://repo.or.cz/r/linux.git/objects/pack/pack-3807b40fc5fd7556990ecbfe28a54af68964a5ce.idx
>  http://repo.or.cz/r/linux.git/objects/pack/pack-3807b40fc5fd7556990ecbfe28a54af68964a5ce.pack
> 
> and put them to the corresponding places.
> 
> * then run fetch of pull. I believe it should run fast then. Though I
> have not test it.

You would also need to set up local refs so that git knows you have those objects. The simplest way to do it is to just fetch by dumb-http, which can resume the pack transfer. I think that clone is also very eager to clean up the partial transfer if the initial fetch fails. So you would want to init manually:

  git init linux
  cd linux
  git remote add origin http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
  GIT_SMART_HTTP=0 git fetch -vv

and then you can follow that up with regular smart fetches, which should be much smaller.

It would be even simpler if you could fetch the whole thing as a bundle, rather than over dumb-http. But that requires the server side (or some third party who has fast access to the repo) cooperating and making a bundle available.

-Peff
Previous: Max Kirillov
Message 2 of 2 in “RE: How to resume broke clone ?”
  1. Max KirillovNov 28, 2013
  2. Jeff KingNov 28, 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.