解决gitlab限制上传文件大小的问题

2020-12-13 20:15:43

参考地址 解决gitlab限制上传文件大小的问题

问题



git提交时报错如下:

error: RPC failed ...fatal: The remote end hung up unexpectedly

解决方法

  1. 客户端
    增大本地客户端可以上传代码的大小限制,输入下面的命令即可解决

git config --global http.postBuffer 524288000git config --global https.postBuffer 524288000
  1. 服务端
    服务端的限制有两个地方一个是gitlab本身,另外一个是gitlab使用的nginx。
    gitlab本身也是很好解决的,使用管理员用户登录gitlab在设置Account and limit中加大Maximum attachment size (MB)和Maximum push size (MB)即可解决
    nginx的话修改gitlab.rb这个文件中

nginx['enable'] = true
nginx['client_max_body_size'] = '1024m'
nginx['redirect_http_to_https'] = false
nginx['redirect_http_to_https_port'] = 80

之后重启gitlab

gitlab gitlab-ctl reconfigure
gitlab gitlab-ctl restart

还有要注意的是,我在gitlab前面还加了一个nginx用来做反向代理,所以这个nginx的client_max_body_size也要加


  • 2019-11-04 02:12:42

    genymotion免费版

    genymotion是一套完整的android虚拟环境工具,相对官方android sdk,它的安装和使用简洁方便不臃肿,但是现在genymotion官方网站不再提供个人的下载,这篇博客记录了如何下载和使用genymotion个人版.