threads / discuss / 35418

RE: How to resume broke clone ?

Subject: RE: How to resume broke clone ?

## tl;dr

2 messages between Nov 28, 2013 and Nov 28, 2013.

replies: 1people: 2as markdown or json

Max Kirillov· Nov 28, 2013, 08:32 UTC · lore
> 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.
Br,
-- 
Max
Jeff King· Nov 28, 2013, 09:12 UTC · re: Max Kirillov · lore

Re: How to resume broke clone ?

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

← back to recent threads