Git使用技巧-git相关报错

自己搭建的GitLab私有仓库总会遇到各种各样的奇葩文件,随笔记录下来,备忘!!!

一、推送远端报错

正在推送 develop
Enumerating objects: 15, done.
Delta compression using up to 4 threads
Total 13 (delta 1), reused 0 (delta 0)
POST git-receive-pack (2085022 bytes)
Error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
发布到远程存储库时遇到错误: Git failed with a fatal error.
the remote end hung up unexpectedly
the remote end hung up unexpectedly
Pushing to https://git.xxx.com/xxx.git
Everything up-to-date

1、本地.git文件夹下config文件修改

添加或者修改配置项,允许上传500mb的文件

[http]
    postBuffer = 524288000

这个时候发现推送远端依然报相同的错误

2、修改GitLab部署服务器的Nginx配置文件

增加对应节点client_max_body_size

http {
  server {
    client_max_body_size 500m;
    #其他配置
  }
  # 其他配置
}

重启nginx,systemctl restart nginx,再试问题解决!

原文地址:https://www.cnblogs.com/heeroac18999/p/13356911.html