- Simple script to migrate repositories from Gogs to Gitea using the migration feature of Gitea.
- Before running the script, set the the environment variables for URLs and credentials (see the very top of the script).
- Needs Perl and Mojolicious for
Mojo::UserAgent
. Under Arch Linux, installperl-mojolicious
from the AUR. - Does not allow to migrate only specific repos so far. But the point of this script is to move everything at once. For migrating single repos Gitea's web interface for migrations would be good enough anyways.
Remove remote from all local Git working copies, e.g.:
find -path '*/.git' -exec git -C {}/.. remote remove gogs \;
Remove/migrate URLs still present on other¹ remotes, e.g.:
find -path '*/.git/config' -exec sed -i -e '/pushurl = gogs@martchus.dyn.f3l.de:Martchus/d' -e 's/url = gogs@martchus.dyn.f3l.de:Martchus/url = gitea@martchus.dyn.f3l.de:Martchus/g' {} \;
¹I sometimes create remotes with multiple push URLs for pushing to multiple servers at once.