Migrating from GitHub to self-hosted Gitea

1 Like

@tommi I created this topic to remember to get updates from your experience moving out of GitHub. It’s rare and precious. Good luck with that!

1 Like

Wow, I am honored!

I will document on this page and here my progress. As I noted more than once, I have very limited technical skills, even less time, and I am definitely not a developer. If I am hosting my Gitea instance, it is only thanks to the great YunoHost; hence, I believe I will struggle a lot and take a long time to fully migrate, even if I have only few repositories.

Thank you very much for your love, it is humbling and much appreciated; it makes me very proud of my choice.


I am slowly learning about Gitea and exploring the settings, but I am now stumbling into the first problems.

On my MacBook, I configured git in order to pull and push changes from my Gitea instance:

git remote add gitmi https://gitmi.dev/tommi/CSS.git

nevertheless, when running either git push gitmi or git pull gitmi, I get:

fatal: unable to access 'https://gitmi.dev/tommi/CSS/': error:1400442E:SSL routines:CONNECT_CR_SRVR_HELLO:tlsv1 alert protocol version

I figured this could be a problem due to HTTPS, so I tried to configure a SSH connection, like this:

git remote set-url gitmi git@gitmi.dev:tommi/CSS.git

still, I cannot access the repository, and I get this error:

ssh: connect to host gitmi.dev port 22: Connection refused
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

How can I know which port I should be using? And anyways, why HTTPS is not working? Am I missing a step?

For more context, this is the result when I run ssh -vT git@gitmi.dev:

OpenSSH_8.6p1, LibreSSL 2.8.3
debug1: Reading configuration data /Users/tommi/.ssh/config
debug1: /Users/tommi/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connecting to gitmi.dev port 22.
ssh: connect to host gitmi.dev port 22: Connection refused

Thank you very much in advance.

(Note: I added my SSH key to Gitea, I think it should work…)

1 Like

Here is what I get:

$ git clone https://gitmi.dev/tommi/CSS.git
Clonage dans 'CSS'...
remote: Enumerating objects: 36, done.
remote: Counting objects: 100% (36/36), done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 36 (delta 10), reused 36 (delta 10)
Dépaquetage des objets: 100% (36/36), 21.31 Kio | 661.00 Kio/s, fait.

Registration is not open on this instance and I can’t verify if SSH works. If you don’t mind opening the registration for a short while, I’ll give it a try.

1 Like

Maybe I’m being stupid here but cloning doesn’t require authentication whereas push and pull does, no? Have you added your credentials to your git config on your MacBook?

Also the SSH thing looks like a port issue to me, so you might need to mess around with forwarding to make it work.

I’m doing something similar to you however so I’d be happy to collaborate more closely if you’re up for that! :grinning_face_with_smiling_eyes:

1 Like

How do I do it? Gitea documentation does not mention this. Nevertheless, this appears to be an issue which is unrelated to the port problem, and it might add on top of it.

I uploaded my SSH key:


I created a repository and followed the instructions to clone it:


But it fails with:

$ git clone ssh://gitea@gitmi.dev:50002/dachary/test.git
Clonage dans 'test'...
Warning: Permanently added '[gitmi.dev]:50002,[]:50002' (ECDSA) to the list of known hosts.
Debian GNU/Linux 10
gitea@gitmi.dev's password: 

You should try to resolve that first.

You need to set your username and password using whatever credentials manager the mac uses. Reading this is a good starting place I hope. I’m also not 100% that this is the source of your issue but it won’t hurt to double check!

What the credentials manager is going to do is to store an association with the URL and username in plaintext in a file in your user, and then store the associated password under a much more secure system in some OS based credentials manager (at least it does this on Windows, which is what I use for the moment).



Thank you very much.

To be honest, though, I do not understand what this means, and how I could solve this.

1 Like

Since this is a Gitea installation issue, may I suggest you post it on https://discourse.gitea.io/ ? I’ll followup there and others with more expertise will be able to contribute.