0

I have very slow download speeds. I am trying to clone the Firefox os B2G tree which runs into gigabytes of data. My ISP however doubles my internet speed after 7pm. But, to use the extra bandwidth, I have to restart my router. Is there any way I can stop the download, restart my router, and then continue. If I do this, git hangs indefinitely. I tried running "killall -SIGSTOP git" restart the router and then "killall -SIGCONT git" But it still hangs. Any suggestions? Thanks in advance

Edit: Just to make it clear a python script automates this process because the entire source tree is built from multiple repositories. The python script is repo from the android open source project. Used for making it easier to work with git. I haven't gone through the source code, but it essentially helps unifies multiple repositories and automates the cloning procedure. Little more info here source.android.com/source/developing.html

taz
  • 43
  • 4

1 Answers1

1

Here's what I'd do:

  1. Create a shallow clone with clone's --depth option:

    git clone --depth=1 https://url.to/repository
    

    From the documentation:

    --depth <depth>
    Create a shallow clone with a history truncated to the specified number of revisions.

    This used to mean that you couldn't push, but with Git version 1.9 or later you can now push changes from a shallow clone, so this doesn't limit you too much. You simply don't have the rest of the project's history locally.

  2. If you want to fetch some older commits, say the most recent 20, you can update your repository with

    git fetch --depth=20
    
  3. And, finally, if you ever want to fetch the repository's entire history, you can use

    git fetch --unshallow
    

This approach lets you start working right away, and you can backfill older commits as necessary when your ISP isn't limiting your bandwidth as much.

Community
  • 1
  • 1
ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
  • It seems my question wasn't clear enough. The entire source tree is pulled from multiple repositories (over 100) using a script. So I will have to do that for every repository. But thanks for this tip. This will come in handy in the future. – taz Aug 31 '14 at 16:44