How to remove merge request from GitLab server

前端 未结 4 1931
清酒与你
清酒与你 2021-02-02 06:32

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

4条回答
  •  有刺的猬
    2021-02-02 07:05

    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.

    (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)

    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
    

    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;
    

    You'll get a list of merge request ids and titles. Find the one you'd like to delete and note the 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;
    

    You can now exit out of the PostgreSQL command terminal by typing:

    \q
    

    Your merge request should now be gone from the web interface.

提交回复
热议问题