I recently became unable to push any changes to any of my repositories on Gitlab.com.
I know this sometimes happens if you've changed your SSH keys, or the site's down, but as far as I know, I haven't changed anything in my ~/.ssh
directory, and Gitlab.com appears to be working.
Yet if I run git push
I get the error:
You are not allowed to push code to this project.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Oddly, git pull
still works. I also tried re-cloning the repo, making and commit and pushing, but that still fails. Adding the --verbose
option showed no further details.
I double checked that the SSH key on file in my Gitlab account matches the key on file in my ~/.ssh/id_rsa.pub
file. I also tried adding the entry of my ~/.ssh/config
:
Host gitlab.com
IdentityFile ~/.ssh/id_rsa
but that had no effect.
What's going on here? Why is Gitlab suddenly not accepting the SSH key on file?