如何在 Gerrit UI 中创建一个新的 .git-project 作为另一个目录下的子目录?

How to create a new .git-project in Gerrit UI as a subdirectory below another directory?

我已经设置了 Gerrit,现在已经启动 运行。我有很多已经存在的 git-repositories,这对 Gerrit 来说是 imported/connected。但是一些 git-repositories 聚集在一个目录中,作为它的子目录。 例如,我有一个名为 "sandbox" 的目录,在该目录下我放置了 .git-projects 仅用于学习(如 helloworld.git 和 stm_discovery_playground.git) .

当我从一个已经存在的存储库中克隆时,其中一个是在我执行 Gerrit Init 时导入的存储库,我使用命令进行克隆 git 克隆 ssh://my_username@my_gerrit_host:29418/sandbox/helloworld.git 所以一开始我以为我必须用正斜杠命名新项目才能获得带有子目录的目录。 但是我无法创建名为 sandbox/my_new_project 的新项目。我收到错误消息“400 项目名称无效:sandbox/my_new_project”。 所以这不是这样做的方法。

如何在该目录下的 Gerrit 中创建新项目? 我可以为多个项目创建新的容器目录吗?

您的程序没有问题,您可以使用 "Projects > Create New Project" 项创建 "sandbox/my_new_project"。 “400 invalid project name”错误并没有显示真正发生的事情。实际上,您在执行 git 命令创建存储库时遇到了一些错误。可能是您的 Gerrit 安装有问题。

检查:

  • GERRIT_SITE/logs/error_log 文件
  • GERRIT_SITE directories/files 所有者和权限