解决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也要加


  • 2017-11-06 01:00:17

    撤销git add

    如何撤销git add,不小心执行了git add . 操作,但是又不能提交所有的文件,因为对应不同的分支,现在怎么样可以将git add 撤销回来

  • 2017-11-10 00:06:15

    CORS: credentials mode is 'include'

    XMLHttpRequest cannot load http://localhost/Foo.API/token. The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'http://localhost:5000' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.