当前位置:   article > 正文

Git 下载大型文件错误修复_git 下载大文件

git 下载大文件

系统环境:Ubuntu 20.04

  • 问题1
error: gnutls_handshake() failed: A TLS packet with unexpected length was received. while accessing …
fatal: HTTP request failed
  • 1
  • 2

  • 问题2
warning: redirecting to https:// xxxx .git/
error: RPC failed; HTTP 302 curl 22 The requested URL returned error: 302
fatal: the remote end hung up unexpectedly
  • 1
  • 2
  • 3
  • 分析

    • http.followRedirects 不能自动跳造成此问题
    • 或者git版本不完整,下载大仓库代码时会出现此错误
  • 解决

    • 尝试通过重新编译安装 链接:Git 的编译安装
    • 终端输入
      git config --global http.xxx.git.followRedirects "true"
      xxxhttps.xxx.git
  • ~/.gitconfig 添加

      - 与终端添加的方式同理
    
    • 1
    //添加la的地址
    [http "https:// xxx .git"]
    followRedirects = true
    
    • 1
    • 2
    • 3

  • 问题3
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
  • 1
  • 2
  • 3
  • 4
  • 分析
    • curl的postBuffer的默认值太小,我们需要调整它的大小
    • 网速问题也会造成影响
  • 解决
    • 终端输入
      git config --global http.postBuffer 524288000
      ~/.gitconfig 添加 与终端添加的方式同理

      //这里改成1G了,500M仍然会报错
      [http]
      postBuffer = 1073741824
      
      • 1
      • 2
      • 3
    • ~/.gitconfig 添加

    • 与终端添加的方式同理

      [http]
      postBuffer = 1073741824
      lowSpeedLimit = 0
      lowSpeedTime = 999999
      
      • 1
      • 2
      • 3
      • 4

  • 问题4
    error: RPC failed; curl 56 GnuTLS recv error (-9): Error decoding the received TLS packet.
    fatal: the remote end hung up unexpectedly
    fatal: early EOF
    fatal: index-pack failed
    
    • 1
    • 2
    • 3
    • 4
  • 解决
    sudo apt-get install gnutls-bin
    #上述已经配置好,无需重复配置
    git config --global http.sslVerify false
    git config --global http.postBuffer 1048576000
    #临时修改mtu 
    ifconfig eth0 mtu 9000
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
  • 问题5
    error: RPC failed; HTTP 502 curl 22 The requested URL returned 
    error: 502 Proxy Error fatal:
    
    • 1
    • 2
  • 解决
    unset http
    unset https
    
    • 1
    • 2
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/正经夜光杯/article/detail/760469
推荐阅读
相关标签
  

闽ICP备14008679号