learning_record_doc/GIt 错误记录.md
2022-04-26 01:02:49 +08:00

45 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 1.The remote end hung up unexpectedly
#### push远程仓库错误 411
```ruby
RPC failed; HTTP 411 curl 22 The requested URL returned error: 411 Length Required
fatal: The remote end hung up unexpectedly
```
#### 原因
提交的文件太大(默认是`1M`),导致`push`失败
#### 解决办法
把提交文件大小的上限设置大点就可以了
```bash
git config http.postBuffer 500M
//或全局设置
git config --global http.postBuffer 500M
```
#### push远程仓库错误 413
```ruby
Enumerating objects: 83, done.
Counting objects: 100% (83/83), done.
Delta compression using up to 16 threads
Compressing objects: 100% (72/72), done.
Writing objects: 100% (77/77), 3.03 MiB | 15.59 MiB/s, done.
Total 77 (delta 5), reused 0 (delta 0), pack-reused 0
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly
Everything up-to-date
```
#### 原因
Web服务器阻止了大型上传文件
#### 解决方案nginx
```bash
#在nginx.conf中添加以下配置 50m 代表最大请求体不能超过50MB 可根据需求进行修改
#nginx.conf 所在路径 /etc/nginx/
client_max_body_size 50m;
#修改后保存文件 执行以下命令重新加载配置
sudo service nginx reload
```