ARTICLE · INTELLIGENCE

战地情报 · 详情页

来自尧图项目组的一线实战观察与深度解析

【git】git 客户端设置本地缓冲区大小

【git】git 客户端设置本地缓冲区大小

文章目录

    • 1. 报错
    • 2. 解决:增加本地缓冲区

1. 报错

git-ccore.quotepath=false-clog.showSignature=false push--progress--porcelainorigin refs/heads/master:master Enumerating objects:17, done. Counting objects:5%(1/17)Counting objects:11%(2/17)Counting objects:17%(3/17)Counting objects:23%(4/17)Counting objects:82%(14/17)Counting objects:88%(15/17)Counting objects:94%(16/17)Counting objects:100%(17/17)Counting objects:100%(17/17), done. Delta compression using up to14threads Compressing objects:6%(1/16)Compressing objects:12%(2/16)Compressing objects:18%(3/16)Compressing objects:25%(4/16)Compressing objects:31%(5/16)Writing objects:62%(10/16)Writing objects:68%(11/16)error: RPC failed;HTTP500curl22The requested URL returned error:500send-pack: unexpected disconnectwhilereading sideband packet Writing objects:75%(12/16)Writing objects:100%(16/16)Writing objects:100%(16/16),1.73MiB|4.47MiB/s, done. Total16(delta0), reused0(delta0), pack-reused0fatal: the remote end hung up unexpectedly

2. 解决:增加本地缓冲区

缓冲区大小默认为 1MB,当传一些比如图片时会报此错。所以要确保服务器的 Git 配置允许足够大的数据传输:

在客户端设置如下命令(设置大小为500M),以便增加本地缓冲区

gitconfig--globalhttp.postBuffer524288000
RELATED READING

延伸阅读

更多一线实战笔记与深度复盘,助您持续精进