Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pause git clone and resume later? [duplicate]

Tags:

git

git-clone

Is there a way to pause git clone and resume it later? I'm cloning a really big repo (around 2GB) and my PC's been turned on for more than 40 hours. I have school to catch later, I don't want to leave it like this. Anybody got an idea? It's already at 67% btw. :(

like image 769
황현정 Avatar asked Oct 18 '11 09:10

황현정


People also ask

How do you pause and clone a git resume?

Depending on your situation (e.g. if you want to close your laptop and / or switch networks), stopping the process (using Ctrl-Z ) and resuming it (using fg ) might work for you. This worked for me, and i have been doing that... stop the process, put the PC into hibernation and resume the process.

How do I continue an interrupted git clone?

Restarting the clone just restarts the process, which is likely to fail again. As a workaround, use a hosted server that has good connectivity to the git repository and ssh access from your local. Clone to the server, then rsync to your local over ssh, and resume the rsync as needed.

Can I clone the same repository twice?

Simply clone your project's repo twice (or even more often). When your work on a feature branch is done, simply push that branch and check it out on your 2nd copy to run tests there. You can pick up a new story and work on that on your "main" project directory.


2 Answers

Depending on your situation (e.g. if you want to close your laptop and / or switch networks), stopping the process (using Ctrl-Z) and resuming it (using fg) might work for you.

like image 104
Jared Avatar answered Sep 28 '22 04:09

Jared


Assuming it's a normal git clone, I'm afraid that they're not resumable, as far as I know. To add support for resumable git clone / git fetch has been a suggested project for the Google Summer of Code in the past.

One exception is if you're actually doing a git svn clone, then you can restart it by changing into the directory and running git svn fetch, but I assume that this is just a normal git repository you're cloning. For some other ideas of how to work around this, you might want to try the suggestions in the answers to this question:

  • How to complete a git clone for a big project on an unstable connection?
like image 25
Mark Longair Avatar answered Sep 28 '22 05:09

Mark Longair