最近使用gitea搭建了自用的git服务平台,用着很不错,今天在进行推送数据时,出现如下错误:
git.exe push --all --progress "origin"
Enumerating objects: 6, done.
Counting objects: 100% (6/6), done.
Delta compression using up to 8 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 40.65 MiB | 24.22 MiB/s, done.
Total 4 (delta 2), reused 0 (delta 0)
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
Everything up-to-date
git 未能顺利结束 (退出码 1) (4797 ms @ 2019/11/12 星期二 10:41:52)
主要错误信息就是:fatal: the remote end hung up unexpectedly,查了一下字面意思为:远端服务异常挂起,百度了下,出现这个问题的实际原因是文件太大超限导致,网上给出的方案大部分都是:修改提交缓存大小,修改当前git库配置文件,添加如下代码(修改为500MB):
[http]
postBuffer = 524288000
不过这种情况一般是出现在提交时报错的话,修改后会起作用,但是并未解决我的问题,思考一下其实就能发现我的情况是在推送时报错,而且提示是服务器那边返回的错误,再次百度,这次找到了真实原因,是由于web服务器上传文件有限制,我这里搭建gitea采用的nginx服务器,也就是需要修改nginx的上传限制,即 client_max_body_size 200m; 改成200MB,再次推送成功。
网友评论