89

Is it possible to move a GitLab repository from one group to another in GitLab?

For example, I have https://gitlab.com/my-user/my-repo. I'd like to move it to https://gitlab.com/my-group/another-group/my-repo.

Ideally, I'd like to keep all the issues associated with it.

Adil Hussain
  • 30,049
  • 21
  • 112
  • 147
opensas
  • 60,462
  • 79
  • 252
  • 386

3 Answers3

148

Yes, you can move your GitLab project from one namespace to another.

Your project -> Settings -> General -> Advanced enter image description here

Then, almost at the end of the list.

Transfer project enter image description here

Chiramisu
  • 4,687
  • 7
  • 47
  • 77
Lukasz Kruszyna
  • 1,734
  • 1
  • 12
  • 6
  • 4
    what role/rights do I need to transfer? I'm the owner of the project but I can see only "Housekeeping" and "Rename repository " no transfer. I use GitLab 11.9.6 – xhudik Apr 18 '19 at 11:58
  • 3
    the page says that repo owner can do the transfer, however as I wrote: me (repo owner) couldn't trasfer the project. I guess there are some rules/policie in repo groups (e.g. http://mygitlab.com/group/myOwnrepo) – xhudik Apr 19 '19 at 19:18
  • 3
    You have to have the correct permissions in both the current and new locations. – Josiah Oct 06 '21 at 14:55
  • 1
    that worked for me, but has a strange effect. After 'transfering' the project I can still push channges to the old remote repo. I did not have to update the local repository to point to the new remote one ? – tom2051 Jan 19 '23 at 15:23
5

In addition to the already accepted answer, if you are not seeing the target group

Go to the group admin section of the TARGET account

https://gitlab.com/groups/<GROUP_NAME>/-/group_members

Add your user and set permissions to at least Maintainer privileges

(create a new group if needed)

maintainer privileges are required

Follow the rest of the instructions from the accepted answer

  • sign into the account that owns the project
  • go to advanced settings at https://gitlab.com/<USER_NAME>/<PROJECT_NAME>/edit
    or click Your project -> Settings -> General -> Advanced
  • Select the group from the drop-down
Daniel
  • 34,125
  • 17
  • 102
  • 150
0

Note at, with GitLab 15.5 (October 2022), you now have:

API endpoint to get project transfer locations

We added a new Projects API endpoint that returns a list of groups to which you can transfer the specified project. Previously, you could select which group to transfer a project to from the dropdown list, which didn’t include groups made available through group sharing. Now, the new endpoint ensures that these groups are included too.

See Documentation and Issue.

That can help if you have to script moving a project to a group, and need to propose a list of possible targets.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250