即使内存设置正确完成,由于远程端的存储库可能损坏,git clone 正在中止

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28810795/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 10:48:25  来源:igfitidea点击:

git clone is aborting due to possible repository corruption on the remote side even though memory settings are done properly

gitgithub

提问by logan

git clone is aborting due to possible repository corruption on the remote side even though memory settings are done properly

即使内存设置正确完成,由于远程端的存储库可能损坏,git clone 正在中止

I would able to fetch and push my codesto same repo. when I try to clone in another machine it says error.

我将能够获取并将我的代码推送到同一个 repo。当我尝试在另一台机器上克隆时,它说错误。

Here is .gitconfig settings

这是 .gitconfig 设置

[pack]
    windowMemory = 1000m
    SizeLimit = 1000m
    threads = 1
    window = 0

Error:

错误:

   Cloning into 'auto_shop'...
    stdin: is not a tty
    remote: Counting objects: 3043, done.
    remote: Compressing objects: 100% (2872/2872), done.
    error: pack-objects died of signal 94.62 MiB | 89.00 KiB/s
    error: git upload-pack: git-pack-objects died with error.
    fatal: git upload-pack: aborting due to possible repository corruption on the remote side.
    fratal: early EOF:  31% (966/3043), 5.68 MiB | 223.00 KiB/s
    emote: aborting due to possible repository corruption on the remote side.
    fatal: index-pack failed

Also, git fsckdoes not give any errors.

此外,git fsck不会给出任何错误。

# git fsck
Checking object directories: 100% (256/256), done.
Checking objects: 100% (2218/2218), done.
dangling commit 7ae478bea3aa6c42cc8fe865c9fc26b35ea9e15d
dangling commit a657b57b65f63f4ffea1c25c77ff62c94471d41a
dangling commit 3c9ef0ff7818812f506fa1d18ef4af4a90a4938d

Please help me how to fix this issue ?

请帮助我如何解决这个问题?

回答by logan

It worked , I set the same config in remote side as well. it worked now..

它有效,我也在远程端设置了相同的配置。它现在起作用了..

git config --global pack.windowMemory "100m"
git config --global pack.SizeLimit "100m" 
git config --global pack.threads "1"
git config --global pack.window "0"

回答by ramwin

I met the same problem. After trying all solutions, it still exists. After compare the config to another repository, I found this config works:

我遇到了同样的问题。在尝试了所有解决方案后,它仍然存在。将配置与另一个存储库进行比较后,我发现此配置有效:

git config core.bigfilethreshold 200K

I think it is because there is a large sql backup file backup.sql(size: 305M), git tryied to analysis it as a text file and see the difference.
After using git config core.bigfilethreshold 200Kgit will not store it deflated nor trying to compress it.

我认为是因为有一个很大的sql备份文件backup.sql(size: 305M),git尝试将其分析为文本文件并查看差异。
使用git config core.bigfilethreshold 200Kgit后不会将其存储放气或尝试压缩它。

So if configurations like pack.windowMemory, pack.SizeLimitdidn't work for you, try using
git config core.bigfilethreshold 200K.

因此,如果像pack.windowMemory, pack.SizeLimit这样的配置对您不起作用,请尝试使用
git config core.bigfilethreshold 200K.