# Migrate local-only GitHub repo to Gitea?

**URL:** <https://forum.gitea.com/t/migrate-local-only-github-repo-to-gitea/12326>\
**Category:** Gitea Usages\
**Created:** [July 17, 2026, 9:01pm UTC](https://forum.gitea.com/t/migrate-local-only-github-repo-to-gitea/12326 "2026-07-17T21:01:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![storebrandslimshady](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/storebrandslimshady/32/7469_2.png) [@storebrandslimshady](https://forum.gitea.com/u/storebrandslimshady)\
**Post date:** [July 17, 2026, 9:01pm UTC](https://forum.gitea.com/t/migrate-local-only-github-repo-to-gitea/12326/1 "2026-07-17T21:01:05Z")

</div>

I used to use [a Docker container for GitHub](https://github.com/linuxserver/docker-github-desktop) 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?

---

<div class="post-metadata">

**Author:** ![storebrandslimshady](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/storebrandslimshady/32/7469_2.png) [@storebrandslimshady](https://forum.gitea.com/u/storebrandslimshady)\
**Post date:** [July 17, 2026, 9:19pm UTC](https://forum.gitea.com/t/migrate-local-only-github-repo-to-gitea/12326/2 "2026-07-17T21:19:05Z")

</div>

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. 😅

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`
