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

The*_*lis 5 git pull object bitbucket

我正在使用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
Run Code Online (Sandbox Code Playgroud)

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

小智 69

我遇到了这个问题,与分支有关。按照@fnagel的类似方法,我刚刚删除了以下文件夹,它解决了问题:

.git/refs/remotes/origin/<name of branch>
Run Code Online (Sandbox Code Playgroud)

  • 当 git pull 期间断电且计算机关闭时出现此问题。这解决了这个问题。谢谢 (4认同)

小智 20

git pull --prune修复了我在存储库上遇到的类似错误消息。


小智 8

删除该holder中的所有内容后.git/refs/remotes/origin/,拉取进度恢复正常。FYR,希望对你有帮助。

  • 这不是与 4 月份的 [@SebK 的答案](/sf/answers/5042845251/) 基本上相同的指导,除了不太具体,因为您可能会删除 _all_ 分支引用? (4认同)

小智 8

删除 .git/refs/remotes/origin 文件夹中的所有内容然后运行。

git pull
Run Code Online (Sandbox Code Playgroud)


Von*_*onC 5

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

git rev-list --verify-objects --stdin --not --all
Run Code Online (Sandbox Code Playgroud)
/*
 * 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.
 */
Run Code Online (Sandbox Code Playgroud)

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

Upacking objects: 100% (34/34), done.
fatal: bad object 4324324....(etc object number)
Run Code Online (Sandbox Code Playgroud)

它不应该绑定到某些BitBucket打嗝,因为它的状态页面很清楚.

所以它可能与一些腐败有关,在另一个贡献者的先前推动中添加了.如果来自任何用户的任何BitBucket repo的任何克隆都会产生相同的消息,则需要联系他们的支持人员以对此repo进行故障排除.