You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Adding repository which exists in repo ROOT but not in DB removes its files #8085
I'm recovering my instance after a server failure with a slightly outdated DB file. Some repositories that physically exist on the disk are not shown in Gogs, which is expected. I've just tried to add (recover) a "new" repository, which already exists by adding a new repo with the same name that it had before the failure.
Achieved result:
Gogs alerts about the path already exists and wipes the repository files completely, and they cannot be recovered anymore
To reproduce
Put the git repo files in your repository ROOT/{user} catalog
Try to add this repo using UI
Observe the files were removed
Expected behavior
Gogs alerts about the path already exists and does nothing more
OR
Gogs merges existing repo files with the "new" repo (less expected for security reasons)
Additional context
UI log message:
An error has occurred : initRepository: initRepository: path already exists: /mnt/Repositories/{user}/{repoName}.git
changed the title [-]Adding repository which exists in repo ROOT removes it completely[/-][+]Adding repository which exists in repo ROOT but not in DB removes its files completely[/+]on Jan 9, 2026
changed the title [-]Adding repository which exists in repo ROOT but not in DB removes its files completely[/-][+]Adding repository which exists in repo ROOT but not in DB removes its files[/+]on Jan 9, 2026
Activity
[-]Adding repository which exists in repo ROOT removes it completely[/-][+]Adding repository which exists in repo ROOT but not in DB removes its files completely[/+][-]Adding repository which exists in repo ROOT but not in DB removes its files completely[/-][+]Adding repository which exists in repo ROOT but not in DB removes its files[/+]repo: prevent data loss by checking directory existence before creati…
repo: prevent data loss by checking directory existence before creati…
repo: prevent data loss by checking directory existence before creati…
repo: prevent data loss by checking directory existence before creati…