khu*_*han 29 git bash clone git-clone
我想克隆LibreOffice.从官方网站上,这是写的:
我们所有的源代码都托管在git中:
克隆:
$ git clone git://anongit.freedesktop.org/libreoffice/core#(浏览)克隆(http):
$ git clone http://anongit.freedesktop.org/git/libreoffice/core.git#慢tar包:
http://download.documentfoundation.org/libreoffice/src/请找到最新版本(通常在底部附近)
现在,当我在git bash中编写此命令进行克隆时,它会开始提取.但是存储库是如此之大,以至于几小时后我失去连接几秒钟,它会回滚下载,我什么也得不到.
有没有办法,即使发生中断,我也可以顺利下载存储库?
PS我是Git的新用户,我使用1 MB DSL互联网连接.存储库必须超过1 GB.
Syl*_*sne 21
可以通过http协议(也称为哑协议)访问存储库:http://anongit.freedesktop.org/git/libreoffice/core.git.
您可以在此处下载所有内容wget或其他下载管理器,您将拥有该存储库的克隆.之后,将目录重命名core.git为.git,并使用以下命令告诉git有关远程URL的信息:
$ git remote add remote http://anongit.freedesktop.org/git/libreoffice/core.git
$ git reset --hard HEAD
Run Code Online (Sandbox Code Playgroud)
Pau*_*icz 15
do'git clone --depth 100'它应该抓住最后100次提交
小智 11
增加缓冲区大小,以便 git 可以正确利用您的带宽。使用以下命令。
git config --global core.compression 0
git config --global http.postBuffer 1048576000
git config --global http.maxRequestBuffer 100M
git clone <repo url>
Run Code Online (Sandbox Code Playgroud)
等待克隆完成。
您可以执行以下操作:
git clone --depth 1 git@github.com:User/Project.git .
git fetch --unshallow
Run Code Online (Sandbox Code Playgroud)
第一个clone仍然是原子的,因此,如果您的连接不够可靠,无法获取当前的HEAD,那么您将遇到麻烦。
fetch如果连接中途断开,则后续操作应该是增量的并且可以重试。