git 在 Gerrit 中删除项目

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8723716/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 12:37:59  来源:igfitidea点击:

Delete a project in Gerrit

gitgerrit

提问by gemfield

I can create a project in Gerrit through:

我可以通过以下方式在 Gerrit 中创建一个项目:

ssh –p 29418 [ip-address] gerrit create-project --name [project-name]

But, how can I delete any project? I haven't see related commands or buttons on web page.

但是,如何删除任何项目?我在网页上没有看到相关的命令或按钮。

采纳答案by Brad

Notice: Since this question was origionally asked, I've released the delete project plugin, and handed it off to the more active Gerrit devs. If you are using Gerrit >= 2.7, I'd recommend this route. If not, read on.

注意:由于这个问题最初被问到,我已经发布了删除项目插件,并将其交给了更活跃的 Gerrit 开发人员。如果您使用 Gerrit >= 2.7,我会推荐这条路线。如果没有,请继续阅读。

There isn't a method to delete projects from Gerrit currently. It must be done by hand. This is the most-requested feature of Gerrit.

目前没有从 Gerrit 中删除项目的方法。它必须手工完成。这是Gerrit 最受欢迎的功能

There are two steps to delete a project by hand:

手动删除项目有两个步骤:

  1. Delete the repository from the server's file system

  2. Delete any references of the repository from the database. The tables to purge depend on the version of Gerrit you are running - the projects table was removed in 2.2.0 for example.

  1. 从服务器的文件系统中删除存储库

  2. 从数据库中删除存储库的任何引用。要清除的表取决于您正在运行的 Gerrit 版本 - 例如,项目表已在 2.2.0 中删除。

If you're deleting a project on an active Gerrit server, you should consider shuting down Gerrit before.

如果您要删除活动 Gerrit 服务器上的项目,则应考虑先关闭 Gerrit。

回答by Christoph Grimmer-Dietrich

Our workflow for deleting projects from gerrit is to first delete the .git directory. After that do

我们从 gerrit 中删除项目的工作流程是首先删除 .git 目录。在那之后做

ssh -p 29418 gerrit.server.local gerrit flush-caches --cache projects

(or --all if you are doing some house keeping anyway ;-) )

(或者 --all,如果你正在做一些家务;-))

回答by djb

See the delete-project plugin

查看删除项目插件

ssh -p 29418 gerrit.example.com delete-project delete --yes-really-delete my-project

We were able to install it in a 2.7 instance

我们能够在 2.7 实例中安装它

The above cited gerrit issue also includes instructions that add a UI button to the project page.

上面引用的 gerrit 问题还包括向项目页面添加 UI 按钮的说明。

回答by user3390950

Deleting the raw .git file from your repository and either flushing the changes or restarting the gerrit service worked for us.

从您的存储库中删除原始 .git 文件并刷新更改或重新启动 gerrit 服务对我们有用。

Note: Make sure you dont have any pending reviews for the repository you are deleting.

注意:请确保您要删除的存储库没有任何待审核。

回答by otto

Using Gerrit 2.15.6, I was able to click on a very handy 'Delete Project' button in the Gerrit UI:

使用 Gerrit 2.15.6,我可以在 Gerrit UI 中单击一个非常方便的“删除项目”按钮:

Delete Project in Gerrit

在 Gerrit 中删除项目

at the bottom of the project admin page.

在项目管理页面的底部。

回答by Coco

Deleting didn't work for me and I have no access to the server files, best solution was to hide the project.

删除对我不起作用,我无法访问服务器文件,最好的解决方案是隐藏项目。

  1. On the project page, find Project Options, then State.
  2. In the Stateselect box, choose Hidden.
  3. Press Save Changes.
  1. 在项目页面上,找到Project Options,然后找到State
  2. 状态选择框中,选择隐藏
  3. 保存更改