Deleted branch still visible in branch list and 404 on access #13010

Closed
opened 2025-11-02 10:27:38 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @MrTypename on GitHub (May 19, 2024).

Description

When I delete a branch by web interface or by 'git push' the branch is listed as deleted within the repo branch overview. Following the branch link I get a 404 error. Is this behaviour intended ? Note that after a 'restore' the branch is accessible again. How can I remove a deleted branch completely ?

Note: try.gitea.io is currently not accessible ?!

Gitea Version

1.21.11

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

c0
c1

Git Version

2.40.1

Operating System

Ubuntu 22.04.4

How are you running Gitea?

Docker image:
https://hub.docker.com/layers/gitea/gitea/1.21.11/images/sha256-0abba6432e37944cd13b47aa0c6ffb958e1a22d7b3795c723267ac92163b774f?context=explore

Database

MySQL/MariaDB

Originally created by @MrTypename on GitHub (May 19, 2024). ### Description When I delete a branch by web interface or by 'git push' the branch is listed as deleted within the repo branch overview. Following the branch link I get a 404 error. Is this behaviour intended ? Note that after a 'restore' the branch is accessible again. How can I remove a deleted branch completely ? Note: try.gitea.io is currently not accessible ?! ### Gitea Version 1.21.11 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots ![c0](https://github.com/go-gitea/gitea/assets/36326219/83f97662-ec8e-4e96-82b0-b29666a80d8e) ![c1](https://github.com/go-gitea/gitea/assets/36326219/1ff83bb2-6cc2-41df-a5da-daa52b5e35ef) ### Git Version 2.40.1 ### Operating System Ubuntu 22.04.4 ### How are you running Gitea? Docker image: https://hub.docker.com/layers/gitea/gitea/1.21.11/images/sha256-0abba6432e37944cd13b47aa0c6ffb958e1a22d7b3795c723267ac92163b774f?context=explore ### Database MySQL/MariaDB
GiteaMirror added the issue/not-a-bug label 2025-11-02 10:27:38 -06:00
Author
Owner

@kemzeb commented on GitHub (May 19, 2024):

Thanks for the bug report!

When you delete a branch, we do keep it around in the DB until this cron job goes ahead and removes it and any other deleted branches. From reading the associated code it looks like it is done every midnight for branches that were deleted at least a day ago.

@kemzeb commented on GitHub (May 19, 2024): Thanks for the bug report! When you delete a branch, we do keep it around in the DB until [this cron job](https://github.com/go-gitea/gitea/blob/339bc8bc8fdb4ead3c43b4604b100f83e6f47cb5/services/cron/tasks_basic.go#L105) goes ahead and removes it and any other deleted branches. From reading the associated code it looks like it is done every midnight for branches that were deleted at least a day ago.
Author
Owner

@kemzeb commented on GitHub (May 19, 2024):

From looking around a bit further, you can even configure this particular cron task, see here for more details. For some reason I can't find it in the web documentation so I may file an issue for that.

@kemzeb commented on GitHub (May 19, 2024): From looking around a bit further, you can even configure this particular cron task, see [here](https://github.com/go-gitea/gitea/blob/339bc8bc8fdb4ead3c43b4604b100f83e6f47cb5/custom/conf/app.example.ini#L2043) for more details. For some reason I can't find it in the web documentation so I may file an issue for that.
Author
Owner

@kemzeb commented on GitHub (May 20, 2024):

Created #31022 to add web docs for deleted branch cleanup. Let me know if you have any further questions.

@kemzeb commented on GitHub (May 20, 2024): Created #31022 to add web docs for deleted branch cleanup. Let me know if you have any further questions.
Author
Owner

@lunny commented on GitHub (May 20, 2024):

We can remove the link of the branch name.

@lunny commented on GitHub (May 20, 2024): We can remove the link of the branch name.
Author
Owner

@MrTypename commented on GitHub (May 20, 2024):

Thanks for your fast response. The cron task for this job was disabled. The issue is now solved.

@MrTypename commented on GitHub (May 20, 2024): Thanks for your fast response. The cron task for this job was disabled. The issue is now solved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13010