如何告诉 Gitlab 通过 API 镜像我的 Github 存储库? [英] How can I tell Gitlab to mirror my Github repositories over the API?
问题描述
我已经看到 Gitlab WebUI 允许为来自例如的存储库设置镜像.Github(在 MyCoolRepository --> Settings --> Repository --> Mirroring repositories 下).
I have seen that the Gitlab WebUI allows to set-up mirroring for repositories from e.g. Github (under MyCoolRepository --> Settings --> Repository --> Mirroring repositories).
我已经看到这也可以通过 API:https://docs.gitlab.com/ee/api/projects.html#start-the-pull-mirroring-process-for-a-project
I have seen that this is possible over the API, too: https://docs.gitlab.com/ee/api/projects.html#start-the-pull-mirroring-process-for-a-project
有谁知道这是如何工作的以及 API 需要哪些参数来获取 id
?
Does anyone know how this works and which parameters the API needs for id
?
我想在脚本中自动执行此过程,因为我不想手动为 Gitlab 中的每个存储库设置自动镜像...
I wanted to automate this process in a script because I do not want to set-up the automatic mirroring for each repository in Gitlab by hand...
推荐答案
正如文档所指定的,您只需要使用项目 ID,您可以在以下位置看到:
As the docs specify, you just need to use the project ID, which you can see on:
MyCoolRepository --> 设置 --> 常规
MyCoolRepository --> Settings --> General
或者使用URL-encoded-path
就文档而言,无法设置此镜像配置.
As far as the docs say, there is no way to set up this miroring configuration.
这篇关于如何告诉 Gitlab 通过 API 镜像我的 Github 存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!