PACK在偏移152904485处有坏对象

发布于 2025-02-12 09:45:36 字数 662 浏览 0 评论 0 原文

我正在尝试使用命令在gitlab上克隆一个存储库:

git clone [email protected]:company/folder/project.git

每次我获取此输出时:

remote: Enumerating objects: 3860, done.
remote: Counting objects: 100% (482/482), done.
remote: Compressing objects: 100% (360/360), done.
fatal: pack has bad object at offset 152904485: inflate returned 1
fatal: fetch-pack: invalid index-pack output

事实是,它仅在我的计算机上发生,我测试了完全相同的命令,通过 ssh远程访问Linux Machine /code>,并且效果很好。另外,要提及我在Windows 11上使用 git 是相关的。我该如何解决?

I'm trying to clone a repository on Gitlab with the command:

git clone [email protected]:company/folder/project.git

And every time I get this output:

remote: Enumerating objects: 3860, done.
remote: Counting objects: 100% (482/482), done.
remote: Compressing objects: 100% (360/360), done.
fatal: pack has bad object at offset 152904485: inflate returned 1
fatal: fetch-pack: invalid index-pack output

The thing is, it happens only on my machine, I tested the exact same command accessing a linux machine remotely through ssh and it works just fine. Also, it's relevant to mention that I'm using git on Windows 11. How can I solve this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

德意的啸 2025-02-19 09:45:36

git -c protocol.version=1 clone [email protected]:company/folder/project.git

这个要点/code>)

REPO=$1
DIR=$2
git clone --recurse-submodules $REPO $DIR --depth=1
cd $DIR
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch --depth=10
git fetch --depth=100
...

另一种方法,克隆到有问题的commit: (-- shallow-exclude =< restion>

git clone --shallow-exclude=anOlCommit

有一个围绕index-pack的补丁(2022年6月) 在流中解开大型对象


opotávioAugusto Silva href =“ https://stackoverflow.com/questions/72831506/72831506/pack-has-bad-object-Ats-oftset-152904485/72836780?noredirect = 1 #comment12865767673_72836780

它在Windows 11 CMD上没有起作用,但它在WSL2(Ubuntu)

上起作用

,并且由于和上安装“ nofollow noreferrer”> git ,这可能是有效的解决方法。

As in this thread, start checking the protocol used:

git -c protocol.version=1 clone [email protected]:company/folder/project.git

As bit as in this gist, you could try an incremental clone, using a shallow clone (--depth)

REPO=$1
DIR=$2
git clone --recurse-submodules $REPO $DIR --depth=1
cd $DIR
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch --depth=10
git fetch --depth=100
...

Another approach, clone up to the problematic commit: (--shallow-exclude=<revision>)

git clone --shallow-exclude=anOlCommit

There is a patch in progress around index-pack (June 2022), about unpacking large object in a stream.


The OP Otávio Augusto Silva confirms in the comments:

It didn't worked on Windows 11 cmd but it worked on WSL2 (Ubuntu)

And since Git can be installed on Windows AND on WSL, that could be a valid workaround.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文