【问题标题】:Importing already existing git repo with multiple branches and tags into gerrit将具有多个分支和标签的现有 git repo 导入 gerrit
【发布时间】:2013-10-31 02:55:49
【问题描述】:

我正在尝试将具有多个分支和标签的现有 git 存储库导入 gerrit。我正在关注https://gerrit-review.googlesource.com/Documentation/install-quick.html#_already_existing_project 的官方指南。

但是,当发出 push 命令时,除了我当前所在的“master”之外,所有分支和标签都“被 Gerrit 禁止”。输出是这样的:

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)
[....]

我是管理员,所以这不应该是访问权限问题。

更新: 通过使用 blahdiblah 的脚本 (https://stackoverflow.com/a/16095671/63661),我成功地移动了所有分支。 为了能够传输所有标签,我首先必须使用 gerrit Web 界面为组管理员授予 *refs/tags/** 的 “创建引用” 权限。之后我可以使用 git push --tags 推送它们。

【问题讨论】:

    标签: git gerrit


    【解决方案1】:

    允许refs/* 将现有存储库导入 Gerrit 的最小权限集是为我们准备的:

    • Create Reference(很明显)
    • Forge Author IdentityForge Committer Identity(因为你在推送其他人的提交)
    • Push(很明显)
    • Push Merge Commit(这不包含在Push 中,您可能会有合并提交)
    • Push Annotated Tag(我们在一些标签中使用注解)

    如果你有签名标签,你还需要允许Push Signed Tag,显然。

    最后,如果您计划在某个过渡期间多次运行导入以增量同步存储库,您还需要允许Read 并为所有Push 权限启用Force Push

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-27
      • 2014-03-23
      • 1970-01-01
      • 1970-01-01
      • 2010-12-10
      • 2020-03-24
      相关资源
      最近更新 更多