如何在 GitLab 中一次克隆一个组的所有项目? [英] How to clone all projects of a group at once in GitLab?

查看:162
本文介绍了如何在 GitLab 中一次克隆一个组的所有项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 GitLab 存储库中,我有一个包含 20 个项目的组.我想一次克隆所有项目.这可能吗?

In my GitLab repository, I have a group with 20 projects. I want to clone all projects at once. Is that possible?

推荐答案

不是真的,除非:

  • 你有一个第 21 个项目,它引用其他 20 个作为 子模块.
    (在这种情况下,一个克隆后跟一个 git submodule update --init 就足以克隆并签出所有 20 个项目)

  • you have a 21st project which references the other 20 as submodules.
    (in which case a clone followed by a git submodule update --init would be enough to get all 20 projects cloned and checked out)

或者你以某种方式列出你有权访问的项目(GitLab API for projects),然后循环该结果以克隆每个结果(意味着可以编写脚本,然后作为一个"命令执行)

or you somehow list the projects you have access (GitLab API for projects), and loop on that result to clone each one (meaning that can be scripted, and then executed as "one" command)

自 2015 年以来,Jay Gabez 提到 在评论中(2019 年 8 月)工具 gabrie30/ghorg

Since 2015, Jay Gabez mentions in the comments (August 2019) the tool gabrie30/ghorg

ghorg 允许您快速将组织或用户的所有存储库克隆到单个目录中.

ghorg allows you to quickly clone all of an org's or user's repos into a single directory.

用法:

$ ghorg clone someorg
$ ghorg clone someuser --clone-type=user --protocol=ssh --branch=develop
$ ghorg clone gitlab-org --scm=gitlab --namespace=gitlab-org/security-products
$ ghorg clone --help


另外(2020 年):https://github.com/ezbz/gitlabber

usage: gitlabber [-h] [-t token] [-u url] [--debug] [-p]
                [--print-format {json,yaml,tree}] [-i csv] [-x csv]
                [--version]
                [dest]

Gitlabber - clones or pulls entire groups/projects tree from gitlab

这篇关于如何在 GitLab 中一次克隆一个组的所有项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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