我在GitLab中创建了几个存储库。其中一个用于测试,有一些提交和分支。我想删除或删除这个存储库。我该怎么做呢?


当前回答

点击图标“管理区域” 点击“项目[编号]”链接 点击删除按钮

在这里输入图像描述

在这里输入图像描述

其他回答

2022年更新:

https://gitlab.com/dashboard/projects

待删除项目页面>>设置>>普通>>高级>>删除项目

它将要求确认项目名称,一旦输入,选择-“是,删除”

用户必须有权限这样做!

单击要删除的项目。 单击右下角的“设置”。 点击“常规”进入高级 而不是删除项目

开放项目 设置(在左侧栏中) 一般 高级设置(点击展开) 删除项目(页面底部) 确认(输入项目名称并按确认键)

对于2021年的Gitlab版本

Go to the project page. URL look like this. https://gitlab.com/<username>/<project name> Select "Settings" in the left sidebar Select the "General" section (you must be in the repository you want to delete to delete it) If you have enough rights, then at the bottom of the page will be the section named "Advanced". Then Click the "Expand" button. Scroll down in the "Advanced" section, then Click the "Delete project" button. Put and confirm the repository name in the popup, then Click the "Yes, delete project" button.

到今天为止,使用gitlab API v4,你可以通过以下curl请求删除一个项目:

curl -X DELETE --header "PRIVATE-TOKEN: <personal-access-token>" https://<gitlab-host>/api/v4/projects/<project-id>

地点:

personal-access-token在用户设置/访问令牌页面上生成,具有api范围, gitlab-host是你自己托管的gitlab域名或gitlab.com, Project-id位于存储库首页的顶部。

如果请求成功,您应该看到以下响应:

{"message":"202 Accepted"}