继续中断git-push(恢复上传) [英] Continue an interrupted git-push (resume upload)
问题描述
[/ 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屋!