如何从 GitLab 服务器中删除合并请求 [英] How to remove merge request from GitLab server
问题描述
我在 gitlab(本地)服务器上创建了一个合并请求.现在,每当我单击合并请求时,请求都会超时并显示错误 500.在此之前,我曾经收到错误代码 504,并且我应用了 这个 gitlab 支持主题.
I created a merge request on gitlab (local) server. Now whenever I click on the merge request, the request times out with error 500. Before that I used to get an error code 504 and I applied the change mentioned in this gitlab support topic.
我想要做的就是删除合并请求.有手动的方法吗?
All I want to do is remove the merge request. Is there a manual way of doing this?
推荐答案
是的,有....我找不到在用户界面中删除合并请求的方法,但您可以简单地从数据库中删除它.
Yes, there is.... I could not find a way to remove the merge request in the user interface, but you can simply delete it from the database.
(请注意,我仅在 Ubuntu 14.04.3 LTS 上的 gitlab CE 8.4.0-ce.0 上对此进行了测试.其他版本可能具有不同的数据库结构)
(Please note, that I only tested this on gitlab CE 8.4.0-ce.0 on Ubuntu 14.04.3 LTS.. Other versions may have a different database structure)
在命令提示符下,执行以下命令(以 root 身份):
At a command prompt, execute the following command (as root):
sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql -h /var/opt/gitlab/postgresql -d gitlabhq_production
这将打开一个 PostgreSQL 命令终端.接下来,您必须找到要删除的合并请求.在 PostgreSQL 命令终端输入以下内容:
This will bring up a PostgreSQL command terminal. Next, you'll have to find the merge request you'd like to delete. Type the following at the PostgreSQL command terminal:
select id, title from merge_requests;
您将获得合并请求 ID 和标题的列表.找到您要删除的并记下 id
You'll get a list of merge request ids and titles. Find the one you'd like to delete and note the id
好的,假设您找到了要删除的合并请求,并且 id
是 5
.您只需使用以下 SQL 命令删除与该合并请求关联的所有数据.(将以下命令中的 5
替换为您的实际合并请求 id
)
OK, let's say you've found the merge request you'd like to delete and the id
is 5
. You're simply going to delete all the data associated with that merge request using the following SQL commands. (Substitute 5
in the commands below with your actual merge request id
)
delete from merge_requests where id = 5;
delete from merge_request_diffs where merge_request_id = 5;
delete from notes where noteable_type = 'MergeRequest' and noteable_id = 5;
您现在可以通过键入以下内容退出 PostgreSQL 命令终端:
You can now exit out of the PostgreSQL command terminal by typing:
q
您的合并请求现在应该从 Web 界面中消失了.
Your merge request should now be gone from the web interface.
这篇关于如何从 GitLab 服务器中删除合并请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!