Gerrit - 推注释标签 - "未能锁定"

时间:2016-06-30 19:50:00

标签: git tags gerrit

我已经尝试了几种方法将git上带注释的标签推送到由gerrit处理的存储库中。 使用以下命令创建v0.1

# git tag -a -m "message" v0.1

然后,当试图推动......

# git push --tags ssh://<user>@<gerrit server>/<project>

它总是给我一个&#34;未能锁定&#34;错误。

...
 ! [remote rejected] v0.1 -> v0.1 (failed to lock)
...

我已经配置了项目访问权限,可以将Push Annotated Tag添加到refs / tags / * reference中。

我还缺少什么?

**编辑 - 添加gerrit gc和git fsck的结果:

$ ssh -p 29418 <user>@<server> gerrit gc <project> --show-progress
collecting garbage for "<project>":
Pack refs:              100% (13/13)
Counting objects:       78
Finding sources:        100% (78/78)
Getting sizes:          100% (37/37)
Writing objects:        100% (78/78)
Selecting commits:      100% (7/7)
Building bitmaps:       100% (7/7)
Finding sources:        100% (23/23)
Getting sizes:          100% (14/14)
Compressing objects:    100% (3094/3094)
Writing objects:        100% (23/23)
Prune loose objects also found in pack files: 100% (24/24)
Prune loose, unreferenced objects: 100% (24/24)

现在git fsck:

$ git fsck --no-dangling
Checking object directories: 100% (256/256), done.
Checking objects: 100% (101/101), done.

一切似乎都好...... 但是,仍然无法将注释标签推入gerrit。

1 个答案:

答案 0 :(得分:1)

也许您已经在服务器中有一个名为v0.1或v0.1 /的标签。我能够重现运行以下命令的“失败锁定”错误:

git tag -a -m "Test" foo/boo
git push origin tag foo/boo
git tag -d foo/boo
git tag -a -m "Test" foo
git push origin tag foo