美文网首页
git push 代码时提示 413 Request Entit

git push 代码时提示 413 Request Entit

作者: 小枫学幽默 | 来源:发表于2019-05-15 11:36 被阅读0次

现象

当我合并develop分支代码到master分支,提交matser分支到远端的时候提示

Counting objects: 10, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (10/10), done.
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large
fatal: The remote end hung up unexpectedly
Writing objects: 100% (10/10), 2.19 MiB | 3.56 MiB/s, done.
Total 10 (delta 7), reused 0 (delta 0)
fatal: The remote end hung up unexpectedly

原因

出现这个问题是因为公司在服务器上用 Nginx 对 Git 反向代理,一次性提交代码量太多了,超出了 Nginx 的限制。

解决方案

使用 nginx 的配置项 client_max_body_size设置允许最大请求的数据的大小:

server {
    listen 80;
    server_name git.dev.com;

    # 设置最大为 50 M
    client_max_body_size 50m;

    ...
}

相关文章

网友评论

      本文标题:git push 代码时提示 413 Request Entit

      本文链接:https://www.haomeiwen.com/subject/yqxpaqtx.html