github

Key is already in use/There are no SSH keys associated with your account - ERROR: Repository not found


Last week I have set up another Github-Account for my University Projects and successfully pushed some code into a repository. Today I've created a new repository, wrote some code locally, wanted to push and was greeted with the following error:

> git push -u origin main
ERROR: Repository not found.
fatal: Could not read from remote repository.

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

I made sure the ssh-agent is running and the key is added. Still the same error. I tried to clone the (practically empty) repository (everything using ssh). Not possible because of that error.

So I went into my Github-Settings-->SSH and GPG Keys and I'm quite puzzled to see there are no keys. My first thought was that maybe I've set a funny expiry date and it's gone already. So I tried to re-add the key I've created last week to be greeted with:

the key is already in use

Yet there are no ssh-keys associated with my account:

 Key is already in use/There are no SSH keys associated with your account

Could this be some very strange temporary error, do I oversee something obvious or what could this strange behavior be?


Solution

  • Apparently I added this specific key to a repository already. I had to remove it from that very repository so I could add it to the account instead.