git - error: RPC failed; result=22, HTTP code = 400

使用git push 项目(初始化)的时候,出现了 

error: RPC failed; result=22, HTTP code = 400

以为是gitorious 的问题。后GG得以下结果:

Workaround

  • When pushing a large amount of data (initial push of a big repository, change with very big file(s)) may require a higher http.postBuffer setting on your git client (not the server). From https://www.kernel.org/pub/software/scm/git/docs/git-config.html

    http.postBuffer

    Maximum size in bytes of the buffer used by smart HTTP transports when POSTing data to the remote system. For requests larger than this buffer size, HTTP/1.1 and Transfer-Encoding: chunked is used to avoid creating a massive pack file locally. Default is 1 MiB, which is sufficient for most requests.

原来是HTTP/1.1 做长连接POST( Transfer-Encoding: chunked)数据的时候分片缓存大小( http.postBuffer)的影响。修改git客户端配置如下后,问题解决

git config --global http.postBuffer 52428800

其值可以修改为更大。


参考点击打开链接

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值