GitLab SSH推送失败内存malloc失败错误

问题描述 投票:1回答:1

我正在尝试通过ssh将1.4GB的大型.sql文件推送到gitlab项目。但推送失败,出现以下错误: Enumerating objects: 3, done. Counting objects: 100% (3/3), done. remote: fatal: Out of memory, malloc failed (tried to allocate 1452837977 bytes) fatal: sha1 file '<stdout>' write error: Broken pipe error: remote unpack failed: unpack-objects abnormal exit

这是我的gitconfig文件的内容

[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[remote "origin"]
url = my ssh url 
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
git ssh gitlab push
1个回答
1
投票

首先,Git不允许文件大于100 MB。所以,技嘉真的没有机会(或者增加最大尺寸是不好的)!

Git不允许这是有原因的。我们假设您有一个1 GB的文件。 git中的每次提交都不会保存diff,而是会占用该文件的整个快照。所以,最终在3次提交之后,你的repo将是3 GB的大小,它只会杀死你的空间并导致克隆,获取和所有内容的速度减慢。

如果使用git-lfs,指向实际LFS跟踪文件的指针实际上保存在存储库中。 3 GB数据仍然存在于您的远程存储库中(作为BLOB),但并非所有3 GB数据都保存在本地存储库中。根据您的提交哈希值,git-lfs lazily仅下载您当前使用的版本而不是所有三个版本,因此您将只有1 GB文件,无论您正在进行的提交。

© www.soinside.com 2019 - 2024. All rights reserved.