Gitlab RPC failed; result=22, HTTP code = 413 解决方法linux
http://309173854.blog.51cto.com/7370240/1736282nginx
说明:git
最近项目组有同事碰见了一个gitlab push 的问题windows
其报错以下:app
Counting objects: 21230, done.
Delta compression using up to 3 threads.
Compressing objects: 100% (20814/20814), done.
Writing objects: 100% (21230/21230), 632.97 MiB | 9.89 MiB/s, done.
Total 21230 (delta 9495), reused 0 (delta 0)
error: RPC failed; result=22, HTTP code = 413
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-dategitlab
通过了解后,root case 为 push 过大,超过单个文件上传默认限制:post
gitlab 默认commit 文件为5Mspa
gitlab默认上传文件最大10M插件
nginx.conf 默认配置无lient_max_body_size命令行
解决方式:
1、服务端配置修改(修改配置的时候请必定要备份)
1.修改 gitlab/config/gitlab.yml 配置文件187行:
1 |
|
2.修改 gitlab/app/models/note.rb 配置文件39行:
1 |
|
3.修改 /usr/local/nginx/conf/nginx.conf 配置文件,在http模块内添加一行配置:
1 |
|
4.重启gitlab服务 和 nginx 服务
1 2 |
|
2、客户端配置
windows / 插件下:
编辑 git全局配置,添加配置:
[http]
receivepack = true
postBuffer = 524288000
linux / 命令行 下:git config http.postBuffer 524288000
而后就能够推送大文件了(60M) ,可是不建议开启这么大的文件传输限制,其中缘由想必你们懂得 。
关于gitlab ,请你们多多交流,共同进步哦 ~~~