We all rely quite a bit on cloud services that are hosted by faceless corporations, these are generally stable services, but if Google’s actions over the years have shown anything, it’s that these services can disappear overnight without warning. So I try to do cloud backups from time to time for the various services I rely on.
I setup a Gitea server a while ago and never really started using it. Since I read about a few ways to mirror cloud based repositories, I decided to try it out on my Gitea server to get some extra usage out of it. The process is pretty simple to do (especially for my nominal use case of public repositories).
Github
I’m Gitea, we start out with the + icon to add our new repository mirrors:
Pick your source, we’ll be looking at GitHub.
Pick the options for the repo that you’re mirroring. Add the link to GitHub and any other options you want to select, I included the wiki in all my mirrors and make sure the check box for the repo being a mirror is checked as well.
For public repos, you don’t need any sort of authentication, but for private repositories, you will need to set it up.
BitBucket
For BitBucket, we want to start out by creating an app password for your account. This will be used by Gitea to clone your repositories. The app password just needs read access as well, no need for write access.
Next up, use the clone link, give your BitBucket username (not email) and the app password to Gitea and it’ll work.
Conclusion
This worked out pretty well. I now have backups of my public GIT repos along with repos that I rely on. It’s also pretty much set it and forget it so that you don’t have to worry about those backups. Though as always, do check/test your backups regularly.