首先看看我提交代码的时候,报错的信息:
git.exe push --progress "origin" master:master
Counting objects: 43142, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (25108/25108), done.
Writing objects: 100% (43142/43142), 824.64 MiB | 26.18 MiB/s, done.
Total 43142 (delta 14030), reused 43141 (delta 14030)
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large
Everything up-to-date
git did not exit cleanly (exit code 1) (717417 ms @ 2016/11/1 15:57:57)
网络上给了几个解决方法:
1、https://www.cnblogs.com/feiyujun/p/7755764.html
2、http://www.cnblogs.com/lihaiping/p/6021813.html
我后面找到了另外的一个解决方法:
因为我用了nginx做代理,是因为nginx转发时限制了。
我在nginx配置文件中新增一个配置解决问题:
配置如下:
client_max_body_size 50m;#客户端上传文件最大限制,默认是1m
可以选择在http{ }中设置:client_max_body_size 20m;
也可以选择在server{ }中设置:client_max_body_size 20m;
还可以选择在location{ }中设置:client_max_body_size 20m;
三者到区别是:http{} 中控制着所有nginx收到的请求。而报文大小限制设置在server{}中,则控制该server收到的请求报文大小,同理,如果配置在location中,则报文大小限制,只对匹配了location 路由规则的请求生效。