摘要
解决Git操作报错问题
BUG: remote-curl.c:1457: The entire rpc->buf should be larger than LARGE_PACKET_MAX
error: git-remote-https died of signal 6
fatal: expected flush after ref listing
背景
今天准备推送代码之前,习惯性的 git fetch 时报错(Sourcetree工具报错如图):
问题
#查看Git配置
git config --list
Git配置中的这个属性不知道为什么被设置了很小的值
大概是控制提交文件大小的上限,且和缓存有关,影响了正常使用
解决方案
方案1:修改 http.postbuffer 配置大小为1G
#语法git config --global 变量名称 变量内容
git config --global http.postbuffer 1073741824
此配置可解决提交大文件失败报错的问题,报错信息如下:
RPC failed; HTTP 411 curl 22 The requested URL returned error: 411
Length Required
fatal: The remote end hung up unexpectedly
设置后上传成功大文件,如图:
方案2:或者去掉配置项
#语法git config --global --unset 取消变量名称
git config --global --unset http.postbuffer