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 reposit
Since my comment resolved OPs issue, I'm writing this as an answer.
The problem seems to be in the fact that you have multiple ssh keys for the same host. In your .ssh/config
you have configured 2 hosts - github.com
and github-companyname
. In your company repository, you need to change the remote url in .git/config
from git@github.com:...
to git@github-companyname:...
. Then ssh will use the correct key and you should have no problems with authentication.
For further reading:
When you need to clone an existing repository with your company key, you can apply the same approach.
git clone git@github-companyname:companyname/repositoryname.git
Notice that instead of github.com
, the command uses github-companyname
.