Migrate local-only GitHub repo to Gitea?

I used to use a Docker container for GitHub on my TrueNAS machine, but it’s been giving me all sorts of headaches, to the point where I can’t even launch it right now.

I want to switch to Gitea but keep my repo’s history intact, but all the instructions I find for migration seem like they’re for pulling remote repos from GitHub. Since I’ve always kept mine local, and I can’t even open the container right now, I can’t push it to GitHub to do this.

So, how do I migrate a GitHub repo on my machine to Gitea on the same machine without using GitHub’s servers?

I figured this out, and since I can’t delete the post without mod approval I might as well post the solution in case anyone else has trouble with basic functionality like I was. :sweat_smile:

  1. Create your Gitea repo and don’t initialize it with anything.
  2. On the system terminal, cd into the directory of the repo to be copied.
  3. git remote add origin http://192.168.[X].[Y]:[Z]/[username]/[repo-name].git
  4. git branch -M main
  5. git push -u origin main