使用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. HDU 1027 Ignatius and the Princess II(康托逆展开)

    Ignatius and the Princess II Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K ( ...

  2. 汇编语言指令与debug命令符

    •MOV与ADD指令 汇编指令 控制CPU完成的操作 形式化语法描述 mov ax, 18 将18送入AX (AX)=18 mov   ah, 78 将78送入AH (AH)=78 add ax, 8 ...

  3. JAVA中对Cookie的操作

    (1)往 Cookie 中存值: <%@page import="javax.xml.ws.Response"%> <%@ page language=" ...

  4. iOS - OC RunLoop 运行循环/消息循环

    1.RunLoop 1)运行循环: 运行循环在 iOS 开发中几乎不用,但是概念的理解却非常重要. 同一个方法中的代码一般都在同一个运行循环中执行,运行循环监听 UI 界面的修改事件,待本次运行循环结 ...

  5. 高并发简单解决方案————redis队列缓存+mysql 批量入库(ThinkPhP)

    问题分析 问题一:要求日志最好入库:但是,直接入库mysql确实扛不住,批量入库没有问题,done.[批量入库和直接入库性能差异] 问题二:批量入库就需要有高并发的消息队列,决定采用redis lis ...

  6. list map vector set 常用函数列表

    #include <stdio.h> #include <iostream>//cin,cout #include <sstream>//ss transfer. ...

  7. ORA-12705: Cannot access NLS data files or invalid environment specified

    ASM实例无法启动 [grid@data ~]$ sqlplus / as sysasm SQL*Plus: Release 11.2.0.4.0 Production on Fri Sep 11 0 ...

  8. hiho1122_二分图匈牙利算法

    题目 给定一个图的N个节点和节点之间的M条边,数据保证该图可以构成一个二分图.求该二分图最大匹配. 题目链接:二分图最大匹配     首先通过染色法,将图的N个节点分成两个部分:然后通过匈牙利算法求二 ...

  9. nginx日志文件切割

    #!/bin/bash #脚本对日志文件进行切割 #脚本需要crontab 每天定时执行 #Nginx 日志文件的存放路径 logs_path="/../logs/" mkdir ...

  10. SQL实现数组的功能

    今天在工作遇到了一个问题,需要往表中添加数量不小而且没有规律的的数据.思考后我想到了使用高级语言中的数组功能解决. 由于SQL Server并没有数组类型,ANSI SQL-92标准中并没有任何有关数 ...