简体   繁体   中英

How to delete a Gitlab repository

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?

Go to Settings > Expand Advanced Settings > Remove Project

从 GitLab 中删除项目

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

  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)
  1. open project
  2. Settings
  3. General section
  4. Expand Advanced Settings

finally Remove

  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.

(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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM