错误
$ git push origin master
Enumerating objects: 338, done.
Counting objects: 100% (338/338), done.
Delta compression using up to 6 threads.
Compressing objects: 100% (314/314), done.
Writing objects: 100% (336/336), 4.39 MiB | 15.84 MiB/s, done.
Total 336 (delta 25), reused 0 (delta 0)
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date
出现这个问题是因为我在服务器上用 Nginx 对 Gogs 反向代理,一次性提交代码量太多了,超出了 Nginx 的限制。
修改nginx配置
server {
listen 80;
server_name git.example.com;
# 设置最大为 50 M
client_max_body_size 50m;
location / {
# 3000 是 Gogs 运行的端口
proxy_pass http://localhost:3000;
}
}
Comments | NOTHING