forgejo/discussions
49
43

After accidentally partially wiping git instance, "The database representation of this repository is out of synchronization" #465

Open
opened 2026年05月05日 04:23:13 +02:00 by Xanderplayz16 · 4 comments

I accidentally wiped the entirety of my git instance, except for the database (whoops). Everything worked fine-ish after I recovered by pushing all the repositories back to the instance (had them all local), but it doesn't recognize new branches, which is really annoying when trying to do practically anything related to pull requests. What can I do to fix this?

I accidentally wiped the entirety of my git instance, except for the database (whoops). Everything worked fine-ish after I recovered by pushing all the repositories back to the instance (had them all local), but it doesn't recognize new branches, which is really annoying when trying to do practically anything related to pull requests. What can I do to fix this?
Xanderplayz16 changed title from (削除) "The database representation of this repository is out of synchronization. If this warning is still shown after pushing a commit to this repository contact the administrator." after accidentally wiping git repository (削除ここまで) to After accidentally wiping git repo, "The database representation of this repository is out of synchronization" 2026年05月05日 04:23:36 +02:00
Xanderplayz16 changed title from (削除) After accidentally wiping git repo, "The database representation of this repository is out of synchronization" (削除ここまで) to After accidentally partially wiping git instance, "The database representation of this repository is out of synchronization" 2026年05月05日 04:25:28 +02:00
Owner
Copy link

Please visit the admin panel and click on "Resynchronize Git hooks of all repositories (pre-receive, update, post-receive, proc-receive, ...)". Depending on the number of repos, this will take a while.
forgejo/forgejo#10397 will make this unnecessary, but it is not yet released. If you are curious, you can also try running an experimental version of Forgejo to see if this would also fix your problem :)

After repairing the hooks, you can then also run "Sync missed branches from Git data to database" and "Sync tags from Git data to database" to fix it once. For new pushes, the hooks should automatically take care of synching.

Please report if this fixed your problem.

Please visit the admin panel and click on "Resynchronize Git hooks of all repositories (pre-receive, update, post-receive, proc-receive, ...)". Depending on the number of repos, this will take a while. https://codeberg.org/forgejo/forgejo/pulls/10397 will make this unnecessary, but it is not yet released. If you are curious, you can also try running an experimental version of Forgejo to see if this would also fix your problem :) After repairing the hooks, you can then also run "Sync missed branches from Git data to database" and "Sync tags from Git data to database" to fix it once. For new pushes, the hooks should automatically take care of synching. Please report if this fixed your problem.

It removed the annoying yellow banner, but even after pushing a commit to main and running both cron jobs, some of the branches still aren't showing up.

It removed the annoying yellow banner, but even after pushing a commit to main and running both cron jobs, some of the branches still aren't showing up.

In the same admin panel you can synchronize branches and tags.

image

In the same admin panel you can synchronize branches and tags. ![image](/attachments/ca51951b-05e7-4663-a61f-93ec0df8f626)

In previous comment:
image

In previous comment: ![image](/attachments/c9e0f6f0-a417-43b5-ae72-d753bc945f72)
3.6 KiB
Sign in to join this conversation.
No Branch/Tag specified
No results found.
No results found.
Labels
Clear labels
User research - Accessibility
Requires input about accessibility features, likely involves user testing.
User research - Blocked
Do not pick as-is! We are happy if you can help, but please coordinate with ongoing redesign in this area.
User research - Community
Community features, such as discovering other people's work or otherwise feeling welcome on a Forgejo instance.
User research - Config (instance)
Instance-wide configuration, authentication and other admin-only needs.
User research - Errors
How to deal with errors in the application and write helpful error messages.
User research - Filters
How filter and search is being worked with.
User research - Future backlog
The issue might be inspiring for future design work.
User research - Git workflow
AGit, fork-based and new Git workflow, PR creation etc
User research - Labels
Active research about Labels
User research - Moderation
Moderation Featuers for Admins are undergoing active User Research
User research - Needs input
Use this label to let the User Research team know their input is requested.
User research - Notifications/Dashboard
Research on how users should know what to do next.
User research - Rendering
Text rendering, markup languages etc
User research - Repo creation
Active research about the New Repo dialog.
User research - Repo units
The repo sections, disabling them and the "Add more" button.
User research - Security
User research - Settings (in-app)
How to structure in-app settings in the future?
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
forgejo/discussions#465
Reference in a new issue
forgejo/discussions
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?