git拉取大文件失败
root@ubuntux86:# git submodule update --init --recursive Cloning into '/work/VisionFive2/buildroot'... fatal: the remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed fatal: clone of 'https://github.com/starfive-tech/buildroot.git' into submodule path '/work/VisionFive2/buildroot' failed Failed to clone 'buildroot'. Retry scheduled Cloning into '/work/VisionFive2/linux'... error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8) fatal: the remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed fatal: clone of 'https://github.com/starfive-tech/linux.git' into submodule path '/work/VisionFive2/linux' failed Failed to clone 'linux'. Retry scheduled Cloning into '/work/VisionFive2/soft_3rdpart'... fatal: the remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed fatal: clone of 'https://github.com/starfive-tech/soft_3rdpart.git' into submodule path '/work/VisionFive2/soft_3rdpart' failed Failed to clone 'soft_3rdpart'. Retry scheduled Cloning into '/work/VisionFive2/u-boot'... fatal: the remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed fatal: clone of 'https://github.com/starfive-tech/u-boot.git' into submodule path '/work/VisionFive2/u-boot' failed Failed to clone 'u-boot'. Retry scheduled Cloning into '/work/VisionFive2/buildroot'... fatal: the remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed fatal: clone of 'https://github.com/starfive-tech/buildroot.git' into submodule path '/work/VisionFive2/buildroot' failed Failed to clone 'buildroot' a second time, aborting
- You can force git using http version 1.1
root@ubuntux86:# git config --global http.version HTTP/1.1
apt install gnutls-bin
1. Turn off compression:
$ git config --global core.compression 0 |
2. do a partial clone to truncate the amount of info coming down:
git clone --depth 1 https://github.com/starfive-tech/buildroot.git
root@ubuntux86:# git clone --depth 1 https://github.com/starfive-tech/buildroot.git Cloning into 'buildroot'... remote: Enumerating objects: 15726, done. remote: Counting objects: 100% (15726/15726), done. remote: Compressing objects: 100% (14574/14574), done. error: RPC failed; curl 18 transfer closed with outstanding read data remaining fatal: the remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed
改成
git clone git@github.com
root@ubuntux86:# git clone git@github.com:starfive-tech/buildroot.git Cloning into 'buildroot'... remote: Enumerating objects: 25774, done. remote: Counting objects: 100% (25774/25774), done. remote: Compressing objects: 100% (18845/18845), done. remote: Total 25774 (delta 6526), reused 25755 (delta 6516), pack-reused 0 (from 0) Receiving objects: 100% (25774/25774), 380.98 MiB | 5.78 MiB/s, done. Resolving deltas: 100% (6526/6526), done.
第一步生成指定路径下创建文件
ssh-keygen -t rsa -C 接着按下回车,输入指定路径
ssh-keygen -t rsa -b 4096 -C "test@test.com" -f git_rsa Generating public/private rsa key pair. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in git_rsa Your public key has been saved in git_rsa.pub The key fingerprint is: SHA256:ruBF8ss+dkYTG4NeNZ1aiSiJr+epFQUJBRuhepZk8Wo your_email@example.com The key's randomart image is: +---[RSA 4096]----+ | . =*oo . o o | | +.o+.. + = | | + o. o.. + | | + o o.= . | |. E .oo.S= | | + .+oo+ | | .o+o.. | | . ==oo | | o+=+ | +----[SHA256]-----+ root@ubuntux86:# ls git_rsa git_rsa.pub
最后使用以下命令 添加ssh key
git config --global core.sshCommand "ssh -i /dev/VisionFive2/ssh/git_rsa"