Git 克隆致命

Git clone fatal

我在执行 git 克隆时遇到错误。

fatal: pack has bad object at offset 824775943: inflate returned 1
fatal: index-pack failed

它仅在 windows 10、linux git 克隆工作正常

删除 .git 本地代码级别的隐藏文件,然后重试。也试试

git config --global --list

查看您启用了哪些配置。如果您发现任何未知配置,您可以删除它们。

如果问题仍然存在,请尝试使用默认设置选项重新安装 git。

谢谢。

以下是导致致命错误的两个主要原因。

1。互联网连接速度慢

错误原因: 存储库很大,互联网连接太慢了。

解决方法:改用更快更稳定的网络连接帮助。

2。巨大的存储库

错误原因: 就文件大小而言,您尝试克隆的存储库很大。在尝试克隆它时,远程服务器根本没有足够的内存来应对执行。

解决方案:

压缩轮次。 Git 部分克隆。成功后,克隆其余部分。

1) 首先,关闭Git压缩。

git config --global core.compression 0

2) 然后使用 --depth 1 参数对存储库进行部分克隆。将 username@domain.com/path/to/git_repo/ 替换为存储库的实际路径。

git clone --depth 1 ssh://username@domain.com/path/to/git_repo/

3) 接下来,检索存储库的其余部分。

git fetch --unshallow

4) 最后,用一个普通的pull来完成它。

git pull --all

这些方法解决了我的问题。希望对您有所帮助!

我的问题是在 git 存储库上推送了一个大文件,git lfs 仅在 windows 上失败 https://github.com/git-lfs/git-lfs/issues/2434

2022 年 1 月更新:git-lfs/git-lfs issue 2434 刚刚关闭。

git-for-windows/git PR 3487: "Teach Git to handle huge files in smudge/clean", in commit cebe3c5处理。

It is fixed in Git for Windows 2.34, but not in Git 2.34.
The patch was specifically applied to Git for Windows, but has not been released in upstream Git yet.