19

I have googled a while now and could not find a solution that fits the current UI of Gitlab. I am trying to remove a repository I previously created on Gitlab. I navigate to edit project by clicking the settings cog on the right. After scrolling down to the bottom I can not find a section called remove project. Instead, I only see rename project. I should have the proper rights because I am the master of the project.

Any ideas?

Schnodderbalken
  • 3,257
  • 4
  • 34
  • 60
  • Does this answer your question? [How to remove a Gitlab project?](https://stackoverflow.com/questions/24032232/how-to-remove-a-gitlab-project) – Jonathan Hall May 28 '20 at 14:56

6 Answers6

41

Go to Settings > Expand Advanced Settings > Remove Project

Remove Project from GitLab

Riz
  • 6,746
  • 16
  • 67
  • 89
8

It seems like master privilege is not sufficient. An owner privilege is required to perform such actions.

Schnodderbalken
  • 3,257
  • 4
  • 34
  • 60
  • 2
    Yeah, GitLab has "improved" UI in such a way that some basic workflows are now confusing for no good reason. – BVengerov May 09 '21 at 04:46
5
  1. Open project
  2. Setting (In the left sidebar)
  3. General
  4. Advanced Setting (Click on Expand)
  5. Remove Project (Bottom of the Page)
  6. Confirm (By typing project name and press Confirm button)
Reza Mirzaei
  • 159
  • 2
  • 4
1
  1. open project
  2. Settings
  3. General section
  4. Expand Advanced Settings

finally Remove

slfan
  • 8,950
  • 115
  • 65
  • 78
Meysam Keshvari
  • 1,141
  • 12
  • 14
0
  1. Open repository
  2. Click 'Settings'
  3. Select 'Options' (if it is not already selected)
  4. Scroll down the page to 'Danger zone'
  5. Click 'Delete this repository'
  6. Follow the instructions.
ahmed.zubaca
  • 107
  • 2
  • 7
0

(Most) of the other answers work.

But: When you are are running a self-hosted gitlab they are not complete.
The repo will not deleted, but only marked as deleted and hidden.

The full solution:
(This is for gitlab 14.8.4, other versions might have some tiny differences)

First let the site forget about it:

  1. Open the project on your gitlab site
  2. Navigate to: Settings > General
  3. Click Expand next to the Advanced section
  4. At the bottom of the page choose Delete project

Gitlab will mark it as deleted and after a couple of minutes a part, but not everything, will be "really" deleted.

After waiting a couple of minutes delete everything that has not been completely deleted:

  1. Open a terminal and search the first 4 hexadecimal chars of the git repo:
    find /var/opt/gitlab/ | perl -ne 'print "$1\n" if(/^.*hashed\/(.{5}).*\+deleted\.git$/)' | sort | uniq
    (Let's assume the output is e6/29 for example)
  2. Double-check if you don't have another repo that starts with the same 4 chars:
    ls /var/opt/gitlab/git-data/repositories/+gitaly/state/@hashed/e6/29
    (Every line should contain the same long hexadecimal string)
  3. Delete everything gitlab didn't delete yet:
    (Some of the dirs might not exist. It depends on how you create your project)
rm -rf /var/opt/gitlab/git-data/repositories/+gitaly/state/@hashed/e6/29
rm -rf /var/opt/gitlab/git-data/repositories/@hashed/e6/29
rm -rf /var/opt/gitlab/gitlab-rails/shared/tmp/gitlab_exports/@hashed/e6/29
Garo
  • 1,339
  • 12
  • 21