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


当前回答

截至2017年9月, 1. 点击你的项目。 2. 选择最上方角落的设置。 3.向下滚动页面,在高级设置前单击展开。 4. 向下滚动页面并单击Remove Project按钮。 5. 在文本框中输入项目名称,然后单击确认。

其他回答

到今天为止,使用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"}

进入项目页面 选择“设置” 选择“General”部分(您必须在想要删除它的存储库中) 如果你有足够的权限,那么在页面底部会有一个“高级设置”按钮(即可能导致数据丢失的项目设置)或“删除项目”按钮(在较新的GitLab版本中)。 按这个按钮,然后按照说明做

这只适用于管理员/所有者。作为一个纯粹的项目维护者,你看不到“移除项目”按钮。

它隐藏在设置菜单,部分通用(不是仓库!)在https://gitlab.com/$USER_NAME/$PROJECT_NAME/editand再次隐藏在部分“高级设置”-你需要点击“展开”按钮。

要删除一个项目,您必须是这个项目的所有者,或者是gitlab的管理员。否则你只能看到“重命名项目”,而没有“删除项目”。

注意:创建者项目并不总是项目的所有者。如果项目在一个项目组中,并且该项目组是由另一个项目组创建的,那么默认情况下,所有者是该项目组的创建者。

您可以在“设置->成员”页面中找到项目所有者的名称。

对于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.