将已有的git repo与多个分支和标签导入gerrit [英] Importing already existing git repo with multiple branches and tags into gerrit
问题描述
我试图将一个已经存在的带有多个分支和标签的git仓库导入gerrit。我遵循 https:// gerrit-review官方指南。然而,当发出push命令时,所有的分支和标签,除了主我目前所在的Gerrit禁止。输出是这样的: 我是管理员它不应该是访问权限问题。 更新: 允许 如果您有签名标签,您还需要允许 最后,如果您计划在某个过渡期间不止一次运行导入来增量式同步存储库,则还需要允许 I'm trying to import an already existing git repository with multiple branches and tags into gerrit. I'm following the official guide at https://gerrit-review.googlesource.com/Documentation/install-quick.html#_already_existing_project. However, when issuing the push command all the branches and tags, except "master" which I'm currently in, are "prohibited by Gerrit". The output is something like this: I'm administrator so it shouldn't be an access rights issue. Update:
By using blahdiblah's script (https://stackoverflow.com/a/16095671/63661) I was successful with moving all the branches.
To be able to transfer all the tags, I first had to give the group Administrators the "Create Reference" permission for *refs/tags/** using the gerrit web interface. After that i could push them using git push --tags. The minimal set of permissions to allow for You also need to allow Finally, if you plan to run the import more than once to incrementally sync repositories during some transition period, you also need to allow 这篇关于将已有的git repo与多个分支和标签导入gerrit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
pre $ user @ host:〜/ my-project $ git push ssh:// user @ localhost :29418 / demo-project *:*
[....]
* [新分支] master - >掌握
! [remote rejected] origin / Branch1 - > origin / Branch1(Gerrit禁止)
! [remote rejected] origin / Branch2 - > origin / Branch2(由Gerrit禁止)
[....]
! [远程拒绝] Tag1 - > Tag1(Gerrit禁止)
! [远程拒绝] Tag2 - > Tag2(由Gerrit禁止)
[....]
通过使用blahdiblah的脚本( https://stackoverflow.com/a/16095671/63661 )我在移动所有分支方面取得了成功。
为了能够传输所有标签,我首先必须使用gerrit web界面为组管理员提供 / tags / **的
refs / *
以将现有的存储库导入Gerrit对我们来说是:
创建引用
(很明显)
伪造作者标识
和 Forge Committer Identity
(因为您推送其他人的提交)
推送
(显然)
推送合并提交
(这不包括在推送$ c $您可能会合并提交)
推注释标记
(我们在一些标记中使用注释)
推送签名标签
。
读取
并为所有推送
权限启用强制推送
p> user@host:~/my-project$ git push ssh://user@localhost:29418/demo-project *:*
[....]
* [new branch] master -> master
! [remote rejected] origin/Branch1 -> origin/Branch1 (prohibited by Gerrit)
! [remote rejected] origin/Branch2 -> origin/Branch2 (prohibited by Gerrit)
[....]
! [remote rejected] Tag1 -> Tag1 (prohibited by Gerrit)
! [remote rejected] Tag2 -> Tag2 (prohibited by Gerrit)
[....]
refs/*
in order to import an existing repository to Gerrit was for us:
Create Reference
(quite obviously)Forge Author Identity
and Forge Committer Identity
(because you are pushing other people's commits)Push
(quite obviously)Push Merge Commit
(this is not included in Push
, and you'll likely have merge commits)Push Annotated Tag
(we use annotations in some tags)Push Signed Tag
if you have signed tags, obviously.Read
and enable Force Push
for all Push
permissions.