I know that there are a ton of similar questions out there… but I couldn't find anything to help me with my problem. So… here we go.
I'm trying to push a repo to a selfhosted GitLab instance. I had to regenerate my SSH keys and for some reason this broke everything and I just can't figure out why. Whenever I try to push I get the following error:
Connection closed by [HOST] port 22
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I have the new public key added to GitLab and I have reconfigured my SSH config to also use the new key:
Host gitlab.[mydomain]
User git
Hostname gitlab.[mydomain]
IdentityFile ~/.ssh/private/[keyfile]
IdentitiesOnly yes
I've double and tripple checked everything. I am the owner of the Repo, the Repo still exists on the GitLab instance, the url in my .git/config is correct, I've added the correct public key to GitLab and the domain and filename in my ssh config are correct as well… and yet it doesn't work for some reason.
For testing purposes I've created a Repo on GitHub, added that as another remote. I can push to GitHub without any issues. I've even tried adding the same SSH key I use for GitLab to GitHub and editing my entry in the SSH config to match. Pushing still works fine.
I'm really confused at this point and I feel like I'm missing something blatantly obvious… but I just can't get it fixed.