Git: revisions and branches deleted in Git repository are shown in redmine
When using Git repository for the project I've noticed that revisions and branches that were deleted from the repository itself are still shown in Redmine repository browser.
Most likely the problem is in Redmine revision cache cause once fetched revisions remain there even after they were deleted in repository.
Steps to reproduce:
1) create branch in Git, make several commits
2) push branch to bare repository that is connected to Redmine
3) make sure that branch is shown in repo browser in Redmine
4) delete branch from bare repository
5) branch is still shown in Redmine :(
#5 Updated by Alexei Kornienko about 7 years ago
No.. this won't help.
Problem is that redmine caches revisions for later use.
So a revision may be deleted in git but it is still cached in redmine.
From my point of view the right solution would be to read git refs to find existing branches and only show commits that are in branch history (the same way as git builds repository history).
Basically right now git repository must be setup on the same server with redmine. It means that in 90% of the cases we don't need redmine revision cache at all since reading from Git directly should be fast enough (caching is needed for remote SVN repository for example).
So another solution would be to disable revision cache for git
#6 Updated by Dietmar H over 5 years ago
Pierre-Luc Samuel wrote:
I don't know if redmine uses git fetch, but a git fetch cmd would use "--prune" to remove branches that were deleted in the repository. Of course, if redmine keeps a cache of the repo, that won't clean it's internal cache...
I just had the same issue, for me adding --prune to the fetch command solved it (Redmine 2.4.1).