本文介绍了如何在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 ),并在该结果上循环以克隆每个结果(表示可以编写脚本,然后作为一个"命令执行)

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 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中一次克隆组中的所有项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-04 21:01