Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the project owner in GitLab

Tags:

gitlab

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?

like image 973
Charma Avatar asked Feb 05 '14 14:02

Charma


People also ask

How do I change the project settings in GitLab?

On the left sidebar, select Settings > General. In the Project name text box, enter your project name. In the Project description text box, enter your project description. Under Project avatar, to change your project avatar, select Choose file.


2 Answers

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.

like image 149
JakeD Avatar answered Oct 29 '22 16:10

JakeD


It is also possible to export the project and import it under a different user. This preserves commits and branches.

Settings -> Advanced -> Export Project

Then to import:

New Project -> Import Project -> Gitlab Export

like image 32
user2789873 Avatar answered Oct 29 '22 15:10

user2789873