Delete a project in Gerrit

微笑、不失礼 提交于 2019-12-29 20:48:07

问题


I can create a project in Gerrit through:

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.


回答1:


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.

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.

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.

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




回答2:


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

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

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




回答3:


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

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




回答4:


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

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




回答5:


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

at the bottom of the project admin page.




回答6:


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 State select box, choose Hidden.
  3. Press Save Changes.


来源:https://stackoverflow.com/questions/8723716/delete-a-project-in-gerrit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!