BitBucket Git 错误:没有发送所有必需的对象

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8788975/
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 06:19:40  来源:igfitidea点击:

BitBucket Git Error: did not send all necessary objects

gitobjectbitbucketpull

提问by Theo Kouzelis

I am using bitbucket and git to revision a project I am currently working on. Today I tried to pull down the latest working copy of the project but was met with an error that I cant seem to find any solution to.

我正在使用 bitbucket 和 git 来修改我目前正在处理的项目。今天我试图拉下项目的最新工作副本,但遇到了一个我似乎无法找到任何解决方案的错误。

$ git pull
Password for 'bitbucket.org':
remote: Counting objects: 65, done.
remote: Compressing objects: 100% (31/31) done.
remote: Total 34 (delta 19), reused 0 (delta 0)
Upacking objects: 100% (34/34), done.
fatal: bad object 4324324....(etc object number)
error: https://bitbucket.org/myusername/myproject.git did not send all necessary objects

I have searched for this error "did not send all necessary objects" but there doesn't seem to be any documentation regarding this issue can anyone help please?

我搜索了这个错误“没有发送所有必要的对象”,但似乎没有关于这个问题的任何文档,有人可以帮忙吗?

采纳答案by VonC

"did not send all necessary objects" is the manifestation of the error, not the error itself.
For information, this message comes from builtin/fetch.cmethod store_updated_refs(), which calls connected.cmethod check_everything_connected(). It performs a

“没有发送所有必要的对象”是错误的表现,而不是错误本身。
有关信息,此消息来自builtin/fetch.cstore_updated_refs(),它调用 connected.c方法check_everything_connected()。它执行一个

git rev-list --verify-objects --stdin --not --all
/*
 * If we feed all the commits we want to verify to this command
 *
 *  $ git rev-list --verify-objects --stdin --not --all
 *
 * and if it does not error out, that means everything reachable from
 * these commits locally exists and is connected to some of our
 * existing refs.
 *
 * Returns 0 if everything is connected, non-zero otherwise.
 */


The real issue is during the unpacking phase:

真正的问题是在解包阶段:

Upacking objects: 100% (34/34), done.
fatal: bad object 4324324....(etc object number)

It shouldn't be tied to some BitBucket hiccup, since its status page is clear.

它不应该与某些 BitBucket 打嗝有关,因为它的状态页面是 clear

So it might be linked to some corruption, added during a previous push by another contributor. If any clone of that BitBucket repo from any user results in the same message, you need to contact the support for them to troubleshoot this repo.

因此,它可能与其他贡献者在先前推动期间添加的某些腐败有关。如果来自任何用户的该 BitBucket 存储库的任何克隆导致相同的消息,您需要联系他们的支持以解决此存储库的问题。

回答by Ribens

git pull --prunefixed the similar error message I had on a repo.

git pull --prune修复了我在 repo 上的类似错误消息。