So I'm doing this pretty huge git-push, about 2 GB of data being pushed to my server. Suddenly my wifi connection dies. So now after transferring over 250 MB over my slow connection, I have to start again, just to risk the whole thing all over.
[/rant]
When doing a git-push to an SSH remote, is there any way to continue the transfer after it failed?
If not, what's the best way to transfer the repository over a flaky connection, while avoiding to have to upload all of the files?
Thanks!
The upstream Git repository will be oblivious to your attempted push, and no change will occur upstream. Unfortunately however, as it doesn't do anything with the half-pushed files, it doesn't store it and then expect a continuation of the push later on either.
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 you are starting a new project from a clone, (from the CLI without a fork) when you push to a blank remote you are pushing the entire history of the project you just cloned. This is going to take some time. If you just need the clone as it stands and you don't want the history, delete the .
rsync your .git directory of your repo to a new directory, say newdir/.git on your server. Then ssh to that server and do a git checkout on any of the branches you have. Then add the local repo that you wanted to push to originally as a remote and do a local push.
As rsync is immune to network interruption you should be able to continue whenever that happens.
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