我试图git克隆LibreOffice代码库,但目前我有一个大约300kbps的互联网连接,它只是什么都不稳定。我可以在任何时候恢复连接,但是git克隆进程已经停止工作,没有办法让它再次运行。有没有什么方法可以让git克隆下载更具抗失败性?
我自己考虑的一个选择是下载别人的.git目录,但这过于依赖他人,对我来说似乎不是最好的解决方案。
我试图git克隆LibreOffice代码库,但目前我有一个大约300kbps的互联网连接,它只是什么都不稳定。我可以在任何时候恢复连接,但是git克隆进程已经停止工作,没有办法让它再次运行。有没有什么方法可以让git克隆下载更具抗失败性?
我自己考虑的一个选择是下载别人的.git目录,但这过于依赖他人,对我来说似乎不是最好的解决方案。
当前回答
使用一个git代理,比如ngitcached或者git-proxy。
其他回答
如果你可以访问第三方服务器,你可以克隆那里,然后复制。
git clone --depth <Number> <repository> --branch <branch name> --single-branch
这个命令帮助了我(感谢尼古拉·帕鲁奇)
例如
git clone --depth 1 https://github.com/gokhanmoral/siyahkernel3 --branch ics --single-branch
我觉得这个还没准备好。有一个旧的GSoC页面计划实现你想要的功能。我最好的办法是,像你建议的那样把它下载成一个目录。我假设你能够通过其他协议恢复下载。
Restartable Clone When cloning a large repository (such as KDE, Open Office, Linux kernel) there is currently no way to restart an interrupted clone. It may take considerable time for a user on the end of a small pipe to download the data, and if the clone is interrupted in the middle the user currently needs to start over from the beginning and try again. For some users this may make it impossible to clone a large repository. Goal: Allow git-clone to automatically resume a previously failed download over the native git:// protocol. Language: C Mentor: Shawn Pearce Suggested by: Shawn Pearce on gmane
更新
除了浅克隆(git clone——depth=1)的建议外,如果有人可以为您创建一个裸库(如果您可以与提供者沟通),这可能会有所帮助。您可以轻松地将裸存储库转换为完整存储库。另外,请阅读答案中的评论,因为肤浅的克隆可能并不总是有帮助。
同样的问题-我有一个非常脆弱的互联网连接,通常不超过10-15 kb/秒:- p
对我来说,wget方法非常有效。
转到有“克隆或下载”绿色按钮的存储库站点,单击它并复制ZIP下载选项的链接。
然后插入到wget命令的链接:
wget -c -m -np https://github.com/your/repository/archive/master.zip
工作起来很有魅力……
“永远不要低估一只信鸽和一捆SD卡的带宽”将是这个答案的现代形式。涂上沥青,简单的cp -a,随便什么,然后把这该死的东西寄出去。找一个愿意花两分钟时间把u盘放进SASE的人。在那里找个联系人,他们甚至可以帮你。