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?
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 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.
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.
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.
cd into the the main directory and run
git fetch
tested only on linux
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With