如何告诉Gitlab通过API镜像我的Github存储库? [英] How can I tell Gitlab to mirror my Github repositories over the API?
问题描述
我已经看到,Gitlab WebUI允许设置来自例如的存储库的镜像. Github(在MyCoolRepository->设置->存储库->镜像存储库下).
I have seen that the Gitlab WebUI allows to set-up mirroring for repositories from e.g. Github (under MyCoolRepository --> Settings --> Repository --> Mirroring repositories).
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
有人知道它是如何工作的,以及id
的API需要哪些参数?
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编码路径
就文档而言,无法设置此镜像配置.
As far as the docs say, there is no way to set up this miroring configuration.
这篇关于如何告诉Gitlab通过API镜像我的Github存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!