gitlab: move repository to another group inside gitlab

I was wondering if it's possible to move a gitlab repo to another group inside gitlab.

for example, if 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, keeping all the issues associated with it

62907 次浏览

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

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

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.