Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resume a git pull/clone after a hung up unexpectedly?

Tags:

git

I do a git pull/clone to some repository (mainly github ones). Sometimes after a few minutes the download crashes.

Here is a log.

remote: Counting objects: 2284, done. remote: Compressing objects: 100% (713/713), done. fatal: The remote end hung up unexpectedlyiB | 5 KiB/s       fatal: early EOF fatal: index-pack failed 

In my following of the process, i have noticed that i have already fetched about 4 MBs of objects. When i start the process again, it starts from the beginning. My Internet connection sucks, some times it crashes and i get disconnected unexpectedly.

My question is: Is there any way to resume the pull/clone to rescue those 4 MBs i have already fetched, and not to start again?

like image 560
Javier Cadiz Avatar asked Feb 06 '13 20:02

Javier Cadiz


People also ask

How do I resume a git clone?

There is currently no way to resume a git clone using git, but there is a neat trick you can use instead of cloning directly -- using git bundle files. Here is how you would do it. Once this is done, you can delete the "clone. bundle" file, unless you think you will need to perform a fresh clone again in the future.

How do I fix a git pull error?

How to Fix error: failed to push some refs to Error in Git Using git pull --rebase. The git pull --rebase command is helpful in situations where your local branch is a commit behind the remote branch.

How do I git clone my resume in terminal?

No, cloning cannot be resumed, if it's interrupted you'd need to start over. If you suspect that there's a good chance that your clone may be interrupted, look for a git bundle that you can download using a protocol that can be resumed.


2 Answers

If a pull hung up, it will not write any changes to your filesystem. This is because, if it would, your local repository would not be in a stable state.

There is no way to resume a pull/clone. So your only choice is to pull/clone again.

like image 137
bpoiss Avatar answered Sep 25 '22 00:09

bpoiss


cd into the the main directory and run

git fetch 

tested only on linux

like image 39
Storm Avatar answered Sep 25 '22 00:09

Storm