如何在 GitLab 中更改项目所有者 [英] How to change the project owner in GitLab

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

问题描述

如何在 GitLab 中更改项目所有者?

项目设置中有选项,但是在传输"字段中,它不识别任何用户名或任何东西.是否可以更改所有者权限和root权限?

解决方案

TL;DR

将您的项目移动到您和其他用户都是所有者的新组,然后其他用户必须将其转移到他自己的命名空间.

背景

其他答案显然不适用于将项目转移给其他用户,尽管一个人的评论部分足以让某人弄清楚.还有 这个关于 GitLab 本身的问题 提供了一些见解.p>

我的情况

我为一些小型开发团队以及我的个人项目安装并管理了几个 GitLab 实例.结果,我遇到了很多关于这个的问题.我一直在回过头来回答这个问题,只是意识到它从未真正得到正确回答.

命名空间问题

您在执行此操作时面临的问题是项目只能有一个所有者,但要转移项目,您必须拥有要转移到的名称空间.据我所知,没有其他方法可以移动项目.为了完整起见,我将在这里添加命名空间,例如 "gitlab.com/my-user-name/..."gitlab.com/my-group-name/...".


解决方案

因为一个用户不能拥有"另一个命名空间(甚至不是管理员),设置两个用户拥有相同命名空间的场景的唯一选项是使用一个组.执行以下步骤来完成此操作.

  1. 创建一个新组.
  2. 将您要向其转移项目的用户添加为该组的所有者成员.
  3. 将您的项目转移到该组(您管理的命名空间,因为您是所有者).
  4. 以其他用户身份登录,然后将组项目转移到其他用户";命名空间.

此时,您将成为项目中的 master.如果需要,您现在可以将自己完全从项目中移除.

How can I change the project owner in GitLab?

There are options in project settings, but in the "transfer" field, it does not recognize any username or anything. Is it possible to change the owner-permissions and root-privileges?

解决方案

TL;DR

Move your project to a new group where both you and the other user are owners, then the other user must transfer it to his own namespace.

Background

The other answers obviously do not work to transfer a project to a different user, although the comments section of one is enough for someone to figure it out. Also there is this issue on GitLab itself that provides some insights.

My Situation

I installed and now administer a few instances of GitLab for a few small developer teams as well as one for my personal projects. Resultingly, I have run into numerous questions about this. I keep coming back to this question only to realize that it was never actually answered correctly.

The Namespace Problem

The issue that you face when doing this is that there can only be one owner of a project, but to transfer a project you have to own the namespace that you are transferring it to. To my knowledge there is no other way to move a project. For completeness, I'll add that the namespace here is, e.g., "gitlab.com/my-user-name/..." or "gitlab.com/my-group-name/...".


Solution

Because one user cannot "own" another namespace (not even admins), the only option to set up a scenario where two users own the same namespace is with a group. Perform the following steps to accomplish this.

  1. Create a new group.
  2. Add the user that you want to transfer your project to as an owner member of that group.
  3. Transfer your project to that group (a namespace you manage because you are an owner).
  4. Login as the other user, then transfer the group project to the "other user" namespace.

At this point you will be left as a master in the project. You can now remove yourself from the project entirely if desired.

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

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