最近git上传代码时,总是出现上传不了的问题:
git报错:
RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
在网上搜索的时候很多人都说修改
git config --global http.postbuffer 524288000
实际上这并解决不了问题
联系运维同事发现,gitlab的nginx配置中,get请求使用的是HTTP/2协议,而post请求则使用的是HTTP/1.1协议,同时根据git报错信息curl 92 HTTP/2 stream 0 was not closed cleanly
,怀疑是HTTP/2协议本身的bug,因此决定修改客户端git上传时所使用的http协议版本。
git config --global http.version HTTP/1.1
通过这个设置修改了git所使用的http协议版本。ok,问题当场解决。