使用gitlab搭建的git server,如果直接使用http的方式去提交的话,提交小文件不会有问题,但是提交大文件时,会出错: fatal: The remote end hung up unexpectedly。

解决办法就是使用ssh提交。

windows下解决方法:

打开git bash

Step1:

ssh-keygen -t rsa -C "YOUREMAIL@DOMAIN.COM"#根据你的邮箱生成一个sshkey

生成成功后,在本地会保存一个私钥,然后将公钥放到gitlab上:
Step2:
cat ~/.ssh/id_rsa.pub
# ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6eNtGpNGwstc.... 就是将ssh-rsa...一串代码粘贴到sshkeys中。 Step3:
修改git 的url为git@server:username/project.git
git remote set-url origin git@gitserver:USERNAME/PROJECT.git 然后再去提交,就可以成功了。 #############提交附件时,如果超过10M,会无法提交###################################
这样解决: 修改gitlab下的models/note.rb文件,将其中对文件大小的限制由10m修改为指定大小: vim /opt/gitlab-6.3.0-0/apps/gitlab/htdocs/app/models/note.rb

找到如下行:validates :attachment, file_size: { maximum: 10.megabytes.to_i }

将10修改为100M

validates :attachment, file_size: { maximum: 100.megabytes.to_i }

如果httpserver使用提nginx,则修改配置文件nginx.conf,在http中加入 client_max_body_size 50m, 这个值默认是1M。

如果http server使用的是apache,则修改配置文件httpd.conf,在最后一行加入指令:LimitRequestBody 2147483647

(RequestBody在byte为单位,上面的指令为允许最大上传2G的文件。

修改完成后,重启gitlab和httpserver即可生效。

Git 提交大文件提示 fatal: The remote end hung up unexpectedly的更多相关文章

  1. git提交报异常,fatal: The remote end hung up unexpectedly

    转自:http://liucanwen.iteye.com/blog/2021601 早上提交代码到 oschina代码库时,报了这个错误: fatal: The remote end hung up ...

  2. git fatal: The remote end hung up unexpectedly 错误

    使用git将本地项目添加到远程仓库报以下错误 $ git push -u origin master fatal: The remote end hung up unexpectedly | 11.0 ...

  3. git 推送出现 "fatal: The remote end hung up unexpectedly" 解决方案

    本文转载于:https://blog.csdn.net/zcmain/article/details/76855595 https://blog.csdn.net/u012973744/article ...

  4. git push fatal: The remote end hung up unexpectedly

    git push fatal: The remote end hung up unexpectedly git config http.postBuffer git gc --aggressive 不 ...

  5. ssh: Could not resolve hostname git.*****-inc.com : Temporary failure in name resolution fatal: The remote end hung up unexpectedly

    问题出现的情景:使用git pull拉取开发的代码到测试服务器,报错: ssh: Could not resolve hostname git.****-inc.com : Temporary fai ...

  6. fatal: The remote end hung up unexpectedly

    git push 的时候出错,提示: fatal: The remote end hung up unexpectedly 遇见几次了,原因是因为文件太大,把限制放宽就好了.命令: git confi ...

  7. Permission denied (publickey). fatal: The remote end hung up unexpectedly 解决办法

    这两天学习git的时候,在本地创建了一个库,同时自己在GitHub上面也创建了一个库,照着廖老师的教程一步一步走到了push的环节突然出现了这样的错误: [zhangxiyu@localhost le ...

  8. Git - error: RPC failed; result=22, HTTP code = 401 fatal: The remote end hung up unexpectedly

    在用Git管理代码版本时,用git push命令提交代码,提示: 有以下几个可能性: Git 版本过低.GitCafe 推荐使用的 Git 版本是 >= 1.7. $ git --version ...

  9. 【Mood-17】 github中在本地进行上传的时候出现ERROR: Repository not found. fatal: The remote end hung up unexpectedly

    一开始出现这个错误的时候还感觉很奇怪,我明明在在本地中相应的库文件夹命令中输入: vim ./git/config 将文件中的 [remote “origin"]部分去掉!

随机推荐

  1. Android内存泄露测试

    Android性能测试过程中的一些常用命令: CPU: adb shell top -n | grep "+PackageName 内存: adb shell dumpsys meminfo ...

  2. XML命名空间详解

    http://happylongnv.blog.hexun.com/48859954_d.html 目的:解决同一个元素在相同文件中代表不同含义的问题.因为XML文档中使用的元素不是固定的,那么两个不 ...

  3. [转载] 多年积累的 mysql 运维经验

    原文: http://mp.weixin.qq.com/s?__biz=MzA3MzYwNjQ3NA==&mid=207132223&idx=1&sn=f5d98146f282 ...

  4. java中compareTo和compare方法之比较

    这两个方法经常搞混淆,现对其进行总结以加深记忆. compareTo(Object o)方法是java.lang.Comparable接口中的方法,当需要对某个类的对象进行排序时,该类需要实现Comp ...

  5. ctrl+enter提交留言

    <!DOCTYPE html><html lang="zh-CN"><head> <meta charset="UTF-8&qu ...

  6. Android 热补丁动态修复框架小结

    一.概述 最新github上开源了很多热补丁动态修复框架,大致有: https://github.com/dodola/HotFix https://github.com/jasonross/Nuwa ...

  7. word2010表格中的内容怎么设置行距

    选中表格,然后根据箭头指示点击 弹出如下对话框,选择行距

  8. dede标签调用

    关键描述调用标签: <meta name="keywords" content="{dede:field name='keywords'/}">&l ...

  9. Mongoose学习参考文档

    一.快速通道 1.1 名词解释 Schema : 一种以文件形式存储的数据库模型骨架,不具备数据库的操作能力 Model : 由Schema发布生成的模型,具有抽象属性和行为的数据库操作对 Entit ...

  10. 正确理解Spring AOP中的Around advice

    Spring AOP中,有Before advice和After advice,这两个advice从字面上就可以很容易理解,但是Around advice就有点麻烦了. 乍一看好像是Before ad ...