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

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

问题描述

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

项目设置中有一些选项,但是在传输"字段中,它无法识别任何用户名或其他任何内容.可以更改所有者权限和根特权吗?

解决方案

TL; DR

将您的项目移到您和另一个用户均为所有者的新组中,然后另一个用户必须将其转移到自己的名称空间中.

背景

其他答案显然无法将项目转移给其他用户,尽管其中一个的注释部分足以使某人弄清楚.另外,有关GitLab本身的问题提供了一些见解.

我的处境

我安装并管理了一些小型开发人员团队的GitLab实例以及一个用于我的个人项目的实例.结果,我遇到了许多与此有关的问题.我一直回到这个问题,只是意识到从未真正正确回答过这个问题.

命名空间问题

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


解决方案

因为一个用户无法拥有"自己的帐户,另一个名称空间(甚至不是管理员),设置两个用户拥有相同名称空间的方案的唯一选择就是使用一个组.执行以下步骤以完成此操作.

  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天全站免登陆