继续中断git-push(恢复上传) [英] Continue an interrupted git-push (resume upload)

查看:771
本文介绍了继续中断git-push(恢复上传)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我正在做这个非常大的git-push,大约2 GB的数据被推送到我的服务器。突然我的wifi连接死亡。所以,现在在我的缓慢连接上传输超过250 MB后,我必须重新开始,只是为了冒险整个过程。



[/ rant]



执行git-push到SSH远程时,有没有办法在失败后继续传输?



如果不是,什么是通过片面连接传输存储库的最佳方式,同时避免必须上传所有文件?



谢谢!

解决方案

将您的.git目录复制到新目录中,在服务器上说newdir / .git。然后ssh到该服务器,并对任何你有的分支做git结账。然后添加您想要推送到本地的本地回购作为远程并进行本地推送。



由于rsync不受网络中断影响,因此您应该能够继续发生这种情况。


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!

解决方案

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.

这篇关于继续中断git-push(恢复上传)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆