如何告诉Gitlab通过API镜像我的Github存储库? [英] How can I tell Gitlab to mirror my Github repositories over the API?

查看:123
本文介绍了如何告诉Gitlab通过API镜像我的Github存储库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到,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).

我已经看到通过API也可以做到这一点:

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆