SOLVED: SSH push to Gitea repo - Unauthorized

This is NOT a request for help. I am documenting a problem I solved, one that I couldn’t find a resolution for on Google, in case anyone else has the same issue.

I migrated a repo from Github to my local Gitea server and found that despite having added my SSH public key to my Gitea account, when I tried to push to Gitea, I couldn’t.

The error I was seeing was “Unauthorized.”

This is not the same as “Permission denied (publickey)”, which is an SSH configuration issue.

I looked at the repository settings, and discovered that when I migrated from Github, I checked the “this is a mirror” checkbox. Gitea created a “pull” mirror.

Apparently, that was the problem.

I never wanted to create a mirror - the Github copy of the repo was going to be deleted. I must have checked that checkbox by accident.

So, I deleted the copy I had in Gitea, did another migration, and this time, I made sure I didn’t check the checkbox. And now I can push over SSH.

I solved my problem, but I am curious whether this is Gitea’s intended behavior. Are you unable to push to a repo you’ve set up as a pull mirror?

1 Like

Yes, you cannot write to pull mirrors, as otherwise your changes would be overwritten when the mirror cron happens.