git error : out of memory, malloc failed (tried to allocated X bytes)

git error : out of memory, malloc failed (tried to allocated X bytes)

我最近在尝试克隆 git 存储库时收到以下错误日志:

remote: Counting objects: 4607, done.
error: git upload-pack: git-pack-objects died with error.B/s      
fatal: git upload-pack: aborting due to possible repository corruption on the remote side.
remote: fatal: Out of memory, malloc failed (tried to allocate 119483755 bytes)
remote: aborting due to possible repository corruption on the remote side.
fatal: early EOF
fatal: index-pack failed

经过调查,错误似乎来自回购服务器。我通过 ssh 连接并尝试了以下所有方法(基本上 google 结果的前两页提出的所有解决方案):

我希望得到一些帮助,谢谢。

这与GIT: fatal: Out of memory, malloc failed (tried to allocate 889192448 bytes)相同。

在 .gitconfig 中进行以下更改解决了我的问题

[http]
    postbuffer = 9999999999

这也可能对您有用。还要检查您的 .gitconfig 文件以及正在使用的文件。也尝试释放您的 RAM,这也可能导致问题。