git 分批后的数据
如果涉及到大文件的 git 传输, 我们可能会收到下面错误:
sourceTree 的错误。

命令行的错误:

$ git clone https://********/gopher.git
Cloning into 'gopher'...
remote: Counting objects: 275, done.
remote: Compressing objects: 100% (234/234), done.
fatal: The remote end hung up unexpectedlyB | 87.00 KiB/s
fatal: early EOF
fatal: index-pack failed
网上提到的解决方案有下面几个:
修改 git 的默认 postBuffer 的大小
如果 是需要 post 的文件比较大, 则可通过修改 git 的默认 postBuffer 的大小
linux
$ git config http.postBuffer 524288000
全局的设置则可以是:
$ git config --global http.postBuffer 524288000
windows:
在 .git/config 文件中加入
[http]
postBuffer = 524288000
http://blog.sina.com.cn/s/blog_71d4414d0100wfwq.html
分步下载
First, turn off compression:
$ git config --global core.compression 0
Next, let's do a partial clone to truncate the amount of info coming down:
$ git clone --depth 1 <repo_URI>
When that works, go into the new directory and retrieve the rest of the clone:
$ git fetch --unshallow
or, alternately,
$ git fetch --depth=2147483647
Now, do a regular pull:
$ git pull --all
I think there is a glitch with msysgit in the 1.8.x versions that exacerbates these symptoms, so another option is to try with an earlier version of git (<= 1.8.3, I think).
当然 git clone 可以变成下面几步:
$ git init
Initialized empty Git repository in /Users/ghj1976/Documents/work/wangpos/git/gopher/.git/
$ git remote add origin https://******/gopher.git
$ git pull --depth 1
remote: Counting objects: 141, done.
remote: Compressing objects: 100% (114/114), done.
remote: Total 141 (delta 4), reused 0 (delta 0)
Receiving objects: 100% (141/141), 1.68 MiB | 45.00 KiB/s, done.
Resolving deltas: 100% (4/4), done.
From https://******/gopher
* [new branch] master -> origin/master
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> master
这里面的 关键 就是用 –depth 获得最近几次的更新记录。 这个数字可以是任意的int数字。
git clone YOUR_REPO --depth=1
git fetch --depth=10
...
git fetch --depth=100
git fetch --unshallow //Downloads all history allowing to push from repo
--depth <depth>
Create a shallow clone with a history truncated to the specified number of revisions. A shallow repository has a number of limitations (you cannot clone or fetch from it, nor push from nor into it), but is adequate if you are only interested in the recent history of a large project with a long history, and would want to send in fixes as patches.
参考资料:
http://stackoverflow.com/questions/21277806/fatal-early-eof-fatal-index-pack-failed
http://stackoverflow.com/questions/4826639/repack-of-git-repository-fails
git 分批后的数据的更多相关文章
- git database 数据库 平面文件 Git 同其他系统的重要区别 Git 只关心文件数据的整体是否发生变化,而大多数其他系统则只关心文件内容的具体差异 Git 的设计哲学
小结: 1.如果要浏览项目的历史更新摘要,Git 不用跑到外面的服务器上去取数据回来 2.注意 git clone 应指定版本,它复制的这个版本的全部历史信息: 各个分支 git init 数据库 ...
- PDA手持扫描资产标签,盘点完成后将数据上传到PC端,固定资产系统查看盘点结果
固定资产管理系统介绍: 致力于研发条码技术.集成条码系统的专业性公司,针对客户的不同需求,提供一站式的企业条码系统解决方案:包括功能强大的软件系统.安全可靠的无线网络.坚固耐用的硬件系统.灵活易用的管 ...
- 如何用perl将表格中不同列的数据进行拼凑,然后将拼凑后的数据用“|”连接在一起
最近写了一个perl脚本,实现的功能是将表格中其中两列的数据进行拼凑,然后将拼凑后的数据用“|”连接在一起. 表格内容如下: 员工号码 员工姓名 职位 入职日期 1001 张三 销售 1980/12/ ...
- SqlServer触发器判断对表操作类型(增、删、改)并将修改后的数据映射到新表
该文章为原创,日后可能会根据实际开发经验和网友评论,进行相应地方修改,为获得最新博客动态,望在转发博客的时候注明出处. 触发器要实现的功能: (1)获取对表Table1数据操作操作类型(insert. ...
- input中空格后的数据不显示
bug,input中空格后的数据不显示 昨天在修bug,有一个bug是用户修改的个人信息的地址栏,输入有空格的话,空格后面的内容存不上,而且没有报错,奇怪了,只好跟踪下. 页面上的输入框就是个 ...
- GDAL 遥感图像处理后的数据保存为图像文件的实现方法
在遥感图像处理中,GDAL库不仅能读取和处理大部分的遥感图像数据,而且还能够实现图像处理后将数据保存为图像的功能. 本文就详细介绍如何将内存中的图像数据保存为.tif格式. 首先,遥感数据处理完,保存 ...
- opencv face-detection 代码分析 (1)人脸识别后的数据
2014,3,16 老师的工作建议如下: 1. 与四民沟通下,把openCV这边的源代码和调用接口发给四民同时抄送给我. 2. 根据openCV的实时检测结果,实现对屏幕的调整(下周一前基本实 ...
- SSL/TLS/WTLS原理(密钥协商的形象化比喻:验证服务器的身份,用服务器的公钥协商加密格式,然后再加密具体的消息,TCP传递SSL处理后的数据)good
一 前言 首先要澄清一下名字的混淆: 1 SSL(Secure Socket Layer)是netscape公司设计的主要用于web的安全传输协议.这种协议在WEB上获得了广泛的应用. 2 IETF( ...
- 转:SqlServer2008误操作数据(delete或者update)后恢复数据
Sqlserver2008误操作数据(delete或者update)后恢复数据(转) 实际工作中,有时会直接在数据库中操作数据,比如对数据进行delete或者update操作,当进行这些操作的时候,如 ...
随机推荐
- iOS开发UI篇—在UITableview的应用中使用动态单元格来完成app应用程序管理界面的搭建
iOS开发UI篇—在UITableview的应用中使用动态单元格来完成app应用程序管理界面的搭建 一.实现效果 说明:该示例在storyboard中使用动态单元格来完成. 二.实现 1.项目文件结构 ...
- Rhel6-puppet集中配置管理系统配置文档
puppet 是一个配置管理工具, 典型的, puppet 是一个 C/S 结构, 当然,这里的 C 可以有很多,因 此,也可以说是一个星型结构. 所有的 puppet 客户端同一个服务器端的 pup ...
- String类实现
String类是应用框架中不可或缺的类 重载运算符实现字符串的操作 #idndef IOTECK_STRING_H_#define IOTECK_STRING_H_namespace iotek{ c ...
- ajax 创建对象验证
function getValue(){ var str = $("#selectid option:selected").val(); //获得选中的值 var num = $( ...
- android贪吃蛇(超级简陋版)
public class body { public int ax;//代表X周变量 public int ay;//代表Y轴变量 public int getAx() { return ax; } ...
- poj3268 最短路
//Accepted 1124 KB 0 ms #include <cstdio> #include <cstring> #include <iostream> # ...
- window2008 r2 负载均衡
两台服务器win2008 r2 ,iis7.5 ip地址192.168.5.16, 192.168.5.18 虚拟ip 192.168.5.30 设置过程: 1.在两台服务器上安装负载均衡模块 ...
- Mybatis-动态 SQL
MyBatis 的强大特性之一便是它的动态 SQL. 如果你有使用 JDBC 或其他类似框架的经验,你就能体会到根据不同条件拼接 SQL 语句有多么痛苦.拼接的时候要确保不能忘了必要的空格,还要注意省 ...
- UVA 208 (DFS)
题意:找出1到T的所有路径: 坑点:一开始以为是到终点,读错了题意,没测试第二个样例,结果WA了4遍,坑大了: #include <iostream> #include <cmath ...
- linux 远程管理
启动linuxssh 服务: /etc/init.d/ssh 启动网络服务: service network restart linux远程登录配置过程: 首先在ubuntu下安装openssh-se ...