通过manifest清单导入项目到gitlab中

文章目录

说明

从gitlab 11.2引入此功能。

GitLab 允许根据manifest清单文件(如 Android 存储库使用的清单文件)导入所需的 Git 存储库。

使用manifest得要求

  • GitLab 必须对其数据库使用 PostgreSQL。
  • 至少是要导入到的目标组上的维护者角色。将开发人员角色用于此目的已在 GitLab 15.8 中弃用,并将在 GitLab 16.0 中删除。
  • 项目的权限必须是public。
  • manifest是基于用户来区别的,也就是说如果你在gitlab上已经成功导入过,那要想再次导入只能通过别的用户再导入。

Manifest 格式

  • manifest清单必须是 XML 文件。
  • 必须有一个remote 的tag,并且里面的 review 属性包含指向 Git 服务器的 URL。
  • 每个项目project 的tag需要有 namepath 属性。GitLab 通过将remote tag中的 URL 与项目名称组合来构建存储库的 URL。路径属性用于表示 GitLab 中的项目路径。

演示示例

AOSP示例文件:https://android.googlesource.com/platform/manifest/+/2d6f081a3b05d8ef7a2b1b52b0d536b2b74feab4/default.xml

案例如下:

bash 复制代码
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <remote  review="https://gitlabjh.bdeet.top/group/" />
  <project path="test/group/agent" name="agent.git" />
  <project path="test/group/codeowners" name="codeowners.git"/>
  <project path="test/group/ds-c" name="ds-c.git" />
  <project path="test/group/ds-c-2" name="ds-c-2.git" />
  <project path="test/group/ds-c-4" name="ds-c-4.git" />
  <project path="test/group/Frontendy" name="Frontend.git" />
  <project path="test/group/terrafrom" name="terrafrom.git" />
</manifest>

导入的过程如下:

相关推荐
运维开发王义杰8 小时前
信息安全:GitLab与AWS OIDC集成的深度解析,IAM信任策略中的条件配置
云计算·gitlab·aws
运维开发王义杰8 小时前
GitLab CI: 告别EC2 Instance Profile,拥抱OIDC
ci/cd·gitlab
Doris_LMS2 天前
Git在idea中的实战使用经验(二)
linux·运维·gitlab·idea
CHENBT_2 天前
mac idea 配置了Gitlab的远程地址,但是每次pull 或者push 都要输入密码,怎么办
gitlab
starvapour2 天前
在windows server 2022搭建gitlab……但是失败了
windows·gitlab
张3蜂2 天前
GitLab Boards 深度解析:选型、竞品、成本与资源消耗
gitlab
烟花的学习笔记2 天前
【科普向-第七篇】Git全家桶介绍:Git/Gitlab/GitHub/TortoiseGit/Sourcetree
git·gitlab·github·tortoisegit·嵌入式软件开发·sourcetree
张3蜂2 天前
Jira vs. GitLab Issues vs. Redmine:终极选型与成本分析
gitlab·jira·redmine
Doris_LMS3 天前
Git在idea中的实战使用经验(一)
java·git·gitlab·idea
未来可期wlkq3 天前
gitlab中回退代码,CI / CD 联系运维同事处理
ci/cd·gitlab