git 将现有的 GitLab 项目移动到新的子组中
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/52778548/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Moving an existing GitLab project into a new subgroup
提问by David McCorrie
Just started out using self hosted GitLab... it looks like it's going to be really useful moving towards a DevOps workflow.
刚开始使用自托管的 GitLab ......看起来它对于转向 DevOps 工作流程非常有用。
Anyway, after migrating about 20 local Git repositories to the new GitLab server, neatly arranged into 4 groups. I then noticed you can actually have sub-groups within the groups. This would help organisation even further, but I'm struggling to work out how to move the existing projects I've spent a day importing and configuring into a newly created sub-group. Sure I could just create a new project and copy the files over and commit them into the new project, and spend the time reconfiguring the project.
无论如何,将大约 20 个本地 Git 存储库迁移到新的 GitLab 服务器后,整齐地分为 4 组。然后我注意到您实际上可以在组内拥有子组。这将进一步帮助组织,但我正在努力解决如何将我花了一天时间导入和配置到新创建的子组中的现有项目移动。当然,我可以创建一个新项目并复制文件并将它们提交到新项目中,然后花时间重新配置项目。
Is there an easy way of moving the existing configured Project from the group into the new subgroup?
是否有一种简单的方法可以将现有的已配置项目从组移动到新的子组中?
回答by David McCorrie
Turns out the "slug" for a project... the part of the URL after the GitLab server domain name is made up of the "namespace" and the project name. The name space is the group/subgroup path, so I was looking to transfer project to new namespace.
结果是项目的“slug”……GitLab 服务器域名后面的 URL 部分由“命名空间”和项目名称组成。命名空间是组/子组路径,所以我希望将项目转移到新的命名空间。
So for example if the group is "important-group" and project is called "project". Then the slug will be something like /important-group/project. To then move that to /important-group/sub-group/project, we need to create the new subgroup (down arrow next to the "New project" button). Then change the project namespace.
例如,如果组是“重要组”并且项目被称为“项目”。然后 slug 将类似于 /important-group/project。然后将其移动到 /important-group/sub-group/project,我们需要创建新的子组(“新建项目”按钮旁边的向下箭头)。然后更改项目命名空间。
To do this, go to the project page, click the settings button (cog bottom left). Go to the Advanced settings section. And it's just below the rename project option.
为此,请转到项目页面,单击设置按钮(齿轮左下角)。转到高级设置部分。它就在重命名项目选项的下方。
Just select the new subgroup and your done!
只需选择新的子组即可完成!
Here is the GitLab docs linkwith more info on managing projects in GitLab, in case that is useful to anyone.
这是 GitLab 文档链接,其中包含有关在 GitLab 中管理项目的更多信息,以防对任何人有用。