Git push失败并显示'error:unpack failed:error Missing unknown <hash>'

时间:2018-05-04 21:22:14

标签: git gerrit

概述

我在使用gerrit-python-tools(gerrit-sync命令)同步repo时遇到问题,错误发生here

1253:    git.push(origin, refspecs='meta/config:refs/meta/config')

重现步骤

我通过执行gerrit-python-tools执行的步骤来重现错误:

首先,创建一个空的git repo:

$ mkdir ~/test && cd ~/test
$ git init
Initialized empty Git repository in /home/user/test/.git/

然后,添加指向我的下游gerrit的遥控器:

$ git remote add gerrit ssh://downstream-ci@localhost:29418/downstream-openstack-dev/project-config

接下来,从gerrit获取meta / config命名空间:

$ git fetch gerrit refs/meta/config:refs/remotes/origin/meta/config
remote: Total 3 (delta 0), reused 3 (delta 0)
Unpacking objects: 100% (3/3), done.
From ssh://localhost:29418/downstream-openstack-dev/project-config
 * [new ref]         refs/meta/config -> origin/meta/config

结帐并修改meta / config:

$ git checkout meta/config
Switched to a new branch 'meta/config'
$ echo "# Add a comment" >> project.config
$ git commit -a -m "test commit"

最后,尝试推送修改后的meta / config:

$ git push gerrit meta/config:refs/meta/config
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 314 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
error: unpack failed: error Missing unknown d02d50c467f01b3b17d2daa6b67c514a1f2bb8da
fatal: Unpack error, check server log
To ssh://downstream-ci@localhost:29418/downstream-openstack-dev/project-config
 ! [remote rejected] meta/config -> refs/meta/config (n/a (unpacker error))
error: failed to push some refs to 'ssh://downstream-ci@localhost:29418/downstream-openstack-dev/project-config

问题

error: unpack failed: error Missing unknown d02d50c467f01b3b17d2daa6b67c514a1f2bb8da是什么意思?

我如何解决此问题?

其它

我正在使用以下工具:

git版本1.8.3.1

Gerrit Code Review(2.12.7)

1 个答案:

答案 0 :(得分:0)

尝试添加&#34; - 不瘦&#34;到你的&#34; git push&#34;命令:

git push --no-thin gerrit meta/config:refs/meta/config