error: RPC failed; result=22, HTTP code = 413 git push时

当执行git push 时,报:

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

fatal: The remote end hung up unexpectedly

fatal: The remote end hung up unexpectedly

是因为HTTP上传数据是有限制,最大不超过500M;

解决这个问题最好的办法是  使用ssh 或者git 协议去上传和下载代码  目前主流都是 SSH的;


当然如果你执意如此只能使用HTTP的话,解决HTTP的大数据上传报错的办法有俩个(仍然解决不了500M以上的):


一, 增加git http 上传Buff 的大小:

git config http.postBuffer 524288000

二,增加服务器端 限制Buff上传的大小:
修改增加 nginx/nginx.conf 中client_max_body_size 的值
http {
    # ...
    client_max_body_size 500M;
    ...#  }


你可能感兴趣的:(git)