error: index-pack died of signal fatal: index-pack failed【Git】

本文介绍在Google云ComputeEngine上,由于内存不足导致克隆Linux源码仓库失败的问题及解决方案,包括使用--depth参数、调整.gitconfig设置和增加交换空间的方法。

error: index-pack died of signal fatal: index-pack failed

环境:

克隆Linux源码时发生错误
git clone https://github.com/torvalds/linux.git

error: index-pack died of signal fatal: index-pack failed

google云Compute Engine
Memory: 0.6GB内存
Linux版本: Debian GNU/Linux 9.5 (stretch)

错误原因

结合网上的博客、以及StackOverFlow的回答,问题原因应该是计算机内不足导致的

解决方法

1.--depth 1 只clone 最近一次的提交

#!/bin/bash
git config --global core.compression 0

git clone --depth 1 <repo_URI>

git fetch --unshallow

git pull --all

2.配置~/.gitconfig

gitconfig --global pack.threads 1

gitconfig --global pack.deltaCacheSize = 128m 
git config --globalpack.windowMemory 1024m

这样一来,应该是可以减小资源的占用,但对于大的git还是无济于事。

3.配置交换空间
原理显而易见,通过提高系统内存,完成大git仓库的clone操作。

转载于:https://www.cnblogs.com/shengwang/p/9993897.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值