从一个 Gerrit 复制到另一个 Gerrit

从一个 Gerrit 复制到另一个 Gerrit

我想将一个项目/存储库从一个 Gerrit 复制到另一个 Gerrit。我的复制配置:

[remote "gerrit3"]
  url = 192.168.1.106:29418/${name}
  adminUrl = gerrit+ssh://192.168.1.106/
  push = refs/*:refs/*
  replicatePermissions = true
  replicateHiddenProjects = true
  mirror = false
  projects = tests/test1
  replicationDelay = 0
  createMissingRepositories = true

触发复制后,我在复制日志中看到以下消息:

[2019-07-25 14:11:00,249] [] scheduling replication tests/test1:..all.. => 192.168.1.106:29418/tests/test1
[2019-07-25 14:11:00,251] [] scheduled tests/test1:..all.. => [f208c682] push 192.168.1.106:29418/tests/test1 to run after 0s
[2019-07-25 14:11:00,253] [f208c682] Replication to 192.168.1.106:29418/tests/test1 started...
[2019-07-25 14:11:00,463] [f208c682] Missing repository created; retry replication to 192.168.1.106:29418/tests/test1
[2019-07-25 14:12:00,465] [f208c682] Replication to 192.168.1.106:29418/tests/test1 started...
[2019-07-25 14:12:00,689] [f208c682] Missing repository created; retry replication to 192.168.1.106:29418/tests/test1
[2019-07-25 14:13:00,690] [f208c682] Replication to 192.168.1.106:29418/tests/test1 started...
[2019-07-25 14:13:00,996] [f208c682] Missing repository created; retry replication to 192.168.1.106:29418/tests/test1

最后两行一直在重复。看起来源 Gerrit 看不到远程存储库,无论远程存储库是否存在。如果不存在,它会正确创建空存储库,但在此之后 Gerrit 仍然看不到它。

答案1

问题出在行上url。文档示例显示未指定协议的 url,但也提到url参数与 url 语法兼容git push。将url行更改为:

url = ssh://[email protected]:29418/${name}

问题已解决。Gerrit 开始查看远程仓库。

相关内容