git提交失败提示 fatal:The remote end hung up unexpectedly
遇到的问题
今天在提交的代码时遇到提交失败的问题,经过测试发现提交较少的文件没有问题,提交的改动比较大的时候就会出现报错,所以基本排除git权限导致的问题。
报错信息如下:
error: RPC failed; HTTP 413 curl 22 The requested URL returned error:413
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
原因分析
经查找相关资料得知可能有如下几个原因:
- 提交的文件太大,http缓冲区大小不够,导致push失败。
- 提交的改动过多,导致本地的暂存区占用太大。
- git服务器做了限制,限制了上传文件的大小。
解决办法
- 第一种原因是最常见的,http的postBuffer不够大,一般将其修改为500M(500*1024*1024=524288000)后即可解决:
git config http.postBuffer 524288000
如上配置只对当前仓库有效,如果想全局生效, 添加–global参数即可。
git config --global http.postBuffer 524288000
- 第二种原因比较少见,主要原因是由于有比较多的零散文件提交或删除导致的,我们可以在提交代码前先运行垃圾回收(garbage collect)命令,给git仓库瘦身来解决这个问题:
git gc --aggressive --prune=now
该命令会收集所有松散对象并将它们存入 packfile,合并这些 packfile 进一个大的 packfile,然后将不被任何 commit 引用并且已存在一段时间 (数月) 的对象删除。(也就是会删除掉一部分历史记录,要慎用,如果不是仓库实在太大了,没必要执行该命令)
- 如果是第三种原因导致的,需要联系服务器后台管理员修改限制值,或分多次提交。
git提交失败提示 fatal:The remote end hung up unexpectedly相关推荐
- git提交代码出现 fatal: The remote end hung up unexpectedly-错误处理
创建了一个GitHub项目,将本地仓库的vue项目推上去,出现这个错误 $ git pushCounting objects: 161, done. Delta compression using u ...
- git 推送出现 “fatal: The remote end hung up unexpectedly“ 解决方案
在使用git推送项目时候出现 "fatal: The remote end hung up unexpectedly " 原因是推送的文件太大. 解决方案: 在克隆/创建版本库生成 ...
- git推送出现fatal: the remote end hung up unexpectedly
特别是资源库在国外的情况下.此问题可能由网络原因引起. 方法一: 修改提交缓存大小为500M,或者更大的数字 git config --global http.postBuffer 524288000 ...
- fatal: The remote end hung up unexpectedly
问题描述 使用 git push 推送代码的时候报错: fatal: The remote end hung up unexpectedly 解决办法 .git目录下面,修改config文件,增加 p ...
- git提交报异常,fatal: The remote end hung up unexpectedly
转自:http://liucanwen.iteye.com/blog/2021601 早上提交代码到 oschina代码库时,报了这个错误: Java代码 fatal: The remote en ...
- git fatal: The remote end hung up unexpectedly 错误
创建了一个GitHub项目,将本地仓库的Java图书推上去,出现这个错误. $ git push Counting objects: 161, done. Delta compression usin ...
- Git 【fatal: The remote end hung up unexpectedly 问题】
出现 "fatal: The remote end hung up unexpectedly" 的原因是推送的文件太大了. 可以先看这篇文章忽略掉 Cocoapods 引入的三方文 ...
- linux git 问题:fatal: early EOF fatal: The remote end hung up unexpectedly fatal: index-pack failed
linux从github git较大的文件时出现的问题,查找以下,暂时关闭防火墙可行,或许还有其他好的解决办法,暂时记录下: 出现问题: git clone --recursive https://g ...
- fatal The remote end hung up unexpectedly
异常信息 Counting objects: 61350, done. Delta compression using up to 2 threads. Compressing objects: 10 ...
最新文章
- “chaos”的算法--之链表面试题
- echart的关系图高亮_echart中饼状图的高亮显示。
- 为什么由Python转go
- ORACLE 培训 -相克军
- 关于正点原子STM32的MDK例程移植到IAR中遇到的错误解决方法 __use_no_semihosting
- window 下内存泄漏检测
- 为X Windows添加TrueType字体
- 华为服务器如何用pe重装系统,教你华为u盘重装win10系统详细图文
- 参数幂等性校验失败_快速入手 Spring Boot 参数校验
- DFA(deterministic finite automaton )有限状态机概念
- python塔防之------“红精灵来袭”
- Python实现熵值法
- Nature Microbiology | 可感染阿斯加德古菌的六种深海沉积物中的病毒基因组
- python爬虫爬取强智教务系统过程
- 四足机器人的六种步态特征
- php如何做查询,php – 如何使用Elastica进行查询
- Python数据分析 第一章 数据分析的概述
- EXCEL中把文本数据转化成数字数据
- 收购WindRiver,Wintel变成Gootel
- 高等数学 · 空间解析几何与向量代数理论笔记小结