1

I'm using repo to download android source code.

I noticed most of the projects are downloaded with the remote compressing of objects into a pack file and then simply getting the pack file and extracting the pack contents. With this, I get .pack and .idx files in .repo/objects/pack/ folder. There aren't any other folders inside objects folder. And when downloading this pack file, if connection breaks , then it is not resumable .

I have also noticed very few projects actually getting downloaded without the remote compressing objects into pack file. For these I don't have the .pack and .idx files. But many individual folders and files inside those folders are created inside the objects folder. I have a few questions regarding this approach.

Will this clone resume when interrupted ? I'm not asking about single file object resume capability. But when interrupted and attempted to redownload, will the already downloaded files be skipped ?? And how is this affected with normal clone and shallow clone ?

Can I request the server to not compress the objects to a pack file while git cloning. If it depends on server, does github and aosp support this?

8
  • What are you actually trying to accomplish, and how why is clone interruption a concern? If you can use a transport that supports packing, you almost definitely want packing.
    – user475162
    Commented Jun 29, 2017 at 1:29
  • Clone interruption is a big concern because the repositories are too big . Few of them are even 2 GB + in size. On slow networks its almost impossible to clone successfully. In such case, if server doesn't transfer pack file, and the individual completed files/objects are not re-downloaded on interruption, I'm thinking of using that way to clone. The individual object files are mostly < 50 MB in size , meaning atmost 50 MB bandwidth waste on every interruption , if they are not re-downloaded.
    – bharat.f4
    Commented Jun 29, 2017 at 2:28
  • That sounds like a very ineffective workaround. Especially if its a task you intend to do multiple times. You probably want to make that a shell script that calls rsync --partial in a loop (e.g. downloading a git-bundle). This will completely remove the necessity for restarting the interrupted download.
    – user475162
    Commented Jun 29, 2017 at 3:04
  • 1
    For a couple of suggestions of that type see stackoverflow.com/questions/3954852/…
    – user475162
    Commented Jun 29, 2017 at 3:12
  • But sadly, asking someone to bundle up the clone is not an available option. I dont think I know anyone who does that favour. If there are any such free services let me know.
    – bharat.f4
    Commented Jun 29, 2017 at 5:33

1 Answer 1

0

This is nicely covered in the answers to the How to complete a git clone for a big project on an unstable connection? Stack Overflow question.

  • git - Does cloning without pack resume when interrupted?

  • Will this clone resume when interrupted ?

  • But when interrupted and attempted to redownload, will the already downloaded files be skipped ?? And how is this affected with normal clone and shallow clone ?

It does not matter how you are doing the clone (shallow or normal) at the time of writing (27th June 2018) resumable cloning is NOT supported by git. If the cloning process is interrupted nicely git will throw the in-progress repo away and if it is interrupted abruptly you will have to throw the repo away by removing it (as it will be corrupt) and start the clone again.

Can I request the server to not compress the objects to a pack file while git cloning.

No you can't - packing is just fundamental to how git works.

Since you mentioned you can't/don't want to use the workarounds that @anr mentioned were listed in https://stackoverflow.com/a/3957733/2732969 (have the repo owner create a bundle of the repo and put that as a regular file on an HTTP server, clone to a shallower depth) your options are limited...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .