api - 如何通过 API 更改 Gitlab 中的镜像设置?

标签 api github gitlab mirror mirroring

我想更改每个存储库的 Gitlab 镜像设置。是否可以通过 Gitlab API 执行此操作?

Gitlab WebUi 允许的选项如下: enter image description here

如何通过 API 更改它们?

备注:这与 "How can I tell Gitlab to mirror my Github repositories over the API?" 不是同一个问题因为我的问题是如何开始镜像,这里我想知道如何更改镜像设置。

最佳答案

关于https://docs.gitlab.com/ee/api/projects.html#edit-project配置拉取镜像有几个参数:

> mirror
> mirror_user_id
> mirror_trigger_builds
> only_mirror_protected_branches
> mirror_overwrites_diverged_branches

Note: If your HTTP repository is not publicly accessible, add authentication information to the URL: https://username:password@gitlab.company.com/group/project.git where password is a public access key with the api scope enabled

请注意,推送镜像尚未实现:https://gitlab.com/gitlab-org/gitlab-ee/issues/7599

关于api - 如何通过 API 更改 Gitlab 中的镜像设置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52554811/

相关文章:

git - 推送到 GitHub 存储库时出现 "Please make sure all files only have LF endings"错误

reactjs - 为什么我的项目中的客户端文件夹没有上传到 gitHub?

gitlab不创建 repo

ruby-on-rails - 获取 Net::ReadTimeout:httparty 中的 Net::ReadTimeout 错误

php - 如何从 php API 运行 casperJS 脚本

Node.js,在私有(private)存储库上创建 github 问题

git - 是否可以在 gitlab 8 中使用自定义 Hook 进行项目提交?

javascript - 创建并填充临时播放列表 Spotify 应用程序

ruby - 有没有包含大多数英语单词的 ruby​​ gem 或 API?

php - 在 cURL PHP 中发送请求时出现 401 未经授权的响应