I registered a personal SSH key months ago and everything worked fine. Now I'm working for a company. They created their own GitHub account and I have started a new repository.
I know I have to add another SSH key, which I did.
This is the content of the ~/.ssh/config file.
Host github.com
HostName github.com
User git
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Host github-companyname
HostName github.com
User git
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa_companyname
I also did ssh <keyname> and I am authenticated.
After that I executed the following commands.
git init
git add
git remote add origin <repo>
It works all fine, until I run git push -u origin master.
I get this error.
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 don't understand. Everything seems to be set up correctly.
Why am I getting that error message?
If that makes any difference, I am using OSX Sierra 10.12.4.
github.comtogithub-companynameas defined in your ssh config.