Deleted Branches Persist in Lists #14895

Closed
opened 2025-11-02 11:25:19 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @zeknoss on GitHub (Aug 23, 2025).

Description

Hello,
We've been using Gitea for our projects for the last couple of months and we are having an issue with persistence of deleted branches.

git branch -r command lists all the deleted branches from day 1 of the projects even after months passed.

Are we missing a config or something? Any help is appreciated.

Gitea Version

1.23.8

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/zeknoss/922d1cb2fd1b09ad83b4d405af3b1e03

Screenshots

Image

Git Version

LTS

Operating System

Debian 12

How are you running Gitea?

We run our gitea server in a docker environment on a remote server and we also use VSCode as our main IDE.
We both tried the UI and Git CLI to list branches to confirm that problem persists.

Database

None

Originally created by @zeknoss on GitHub (Aug 23, 2025). ### Description Hello, We've been using Gitea for our projects for the last couple of months and we are having an issue with persistence of deleted branches. `git branch -r` command lists all the deleted branches from day 1 of the projects even after months passed. Are we missing a config or something? Any help is appreciated. ### Gitea Version 1.23.8 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist https://gist.github.com/zeknoss/922d1cb2fd1b09ad83b4d405af3b1e03 ### Screenshots ![Image](https://github.com/user-attachments/assets/612db813-5196-40f0-b644-088b0b98dd20) ### Git Version LTS ### Operating System Debian 12 ### How are you running Gitea? We run our gitea server in a docker environment on a remote server and we also use VSCode as our main IDE. We both tried the UI and Git CLI to list branches to confirm that problem persists. ### Database None
GiteaMirror added the issue/needs-feedbacktype/bug labels 2025-11-02 11:25:19 -06:00
Author
Owner

@lunny commented on GitHub (Aug 23, 2025):

Have you run git remote update --prune before git branch -r?

@lunny commented on GitHub (Aug 23, 2025): Have you run `git remote update --prune` before `git branch -r`?
Author
Owner

@zeknoss commented on GitHub (Aug 24, 2025):

Have you run git remote update --prune before git branch -r?

Actually, I did not. Thank you!

In my defense, this is the first time I use something other than Gitlab or Github, I never needed to do that with those platforms before.
Is there any way I can do the pruning automated either on Gitea server?

@zeknoss commented on GitHub (Aug 24, 2025): > Have you run `git remote update --prune` before `git branch -r`? Actually, I did not. Thank you! In my defense, this is the first time I use something other than Gitlab or Github, I never needed to do that with those platforms before. Is there any way I can do the pruning automated either on Gitea server?
Author
Owner

@lunny commented on GitHub (Aug 24, 2025):

The command git branch -r does not automatically synchronize branch information from the remote server, regardless of the type of Git server being used.

Will these deleted branches still appear in <gitea_url>///branches? Could you share a screenshot of that page?

@lunny commented on GitHub (Aug 24, 2025): The command `git branch -r` does not automatically synchronize branch information from the remote server, regardless of the type of Git server being used. Will these deleted branches still appear in <gitea_url>/<owner>/<repo>/branches? Could you share a screenshot of that page?
Author
Owner

@zeknoss commented on GitHub (Aug 24, 2025):

@lunny here's a screenshot of branches view of a repo. The deleted branches (except freshly deleted ones) disappear from the UI as they should. However, as per your instructions, the branch list from gitea server will serve the deleted ones if the prune command wasn't called beforehand.

Image
@zeknoss commented on GitHub (Aug 24, 2025): @lunny here's a screenshot of branches view of a repo. The deleted branches (except freshly deleted ones) disappear from the UI as they should. However, as per your instructions, the branch list from gitea server will serve the deleted ones if the `prune` command wasn't called beforehand. <img width="1308" height="827" alt="Image" src="https://github.com/user-attachments/assets/94b3c137-e85b-4ceb-b9ab-b4233daf8634" />
Author
Owner

@lunny commented on GitHub (Aug 28, 2025):

I don't know whether the branch list in vscode will be updated automatically. If it cannot be displayed in the Gitea's Branch list page, it should be deleted from Gitea side.

@lunny commented on GitHub (Aug 28, 2025): I don't know whether the branch list in vscode will be updated automatically. If it cannot be displayed in the Gitea's Branch list page, it should be deleted from Gitea side.
Author
Owner

@zeknoss commented on GitHub (Aug 29, 2025):

I don't know whether the branch list in vscode will be updated automatically. If it cannot be displayed in the Gitea's Branch list page, it should be deleted from Gitea side.

For the time being we're pruning before each fetch and it works fine. Thank you for your help @lunny !

@zeknoss commented on GitHub (Aug 29, 2025): > I don't know whether the branch list in vscode will be updated automatically. If it cannot be displayed in the Gitea's Branch list page, it should be deleted from Gitea side. For the time being we're pruning before each fetch and it works fine. Thank you for your help @lunny !
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14895