Transform GIT repository to mirror in Gitea

First written onSeptember 9, 2023

Mirroring huge GIT repositories with Gitea is not always straight forward. Sometimes you get a timeout error or a connection problem that aborts the repository cloning. Although you can edit Gitea’s mirroring timeout in its configuration, this is not always effective.

Another possibility is to gradually clone the repository by chunks, import it from Gitea and transform it to a mirror. This last part is the hacky part, since to do it you must make a couple of changes in the database. Do a backup first!