I have multiple GitHub accounts set up on my Mac. It used to work great, until recently it just stopped working and I don't know why. My account has my computers ssh key, the ssh config is correct, I am even logged in and authenticated to the account that doesnt work via gh auth
.
Config file
# ~/.ssh/config
# ...
Host github.com-work
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_work
Repo
Check git config
$ git config --list
credential.helper=osxkeychain
user.email=work-username@work.com
...
remote.origin.url=git@github.com-work:work-username/work-repo.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
...
Check gh auth
$ gh auth status
github.com
✓ Logged in to github.com as work-username (/Users/work-username/.config/gh/hosts.yml)
✓ Git operations for github.com configured to use ssh protocol.
✓ Token: *******************
Try to pull
$ git pull
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Notice:
$ ssh -T -i ~/.ssh/id_rsa_work git@github.com
Hi not-work-username! You've successfully authenticated, but GitHub does not provide shell access.
$ ssh -T -i ~/.ssh/id_rsa_work git@github.com-work
Hi not-work-username! You've successfully authenticated, but GitHub does not provide shell access.
$ ssh -T git@github.com
Hi not-work-username! You've successfully authenticated, but GitHub does not provide shell access.
$ ssh -T git@github.com-work
Hi not-work-username! You've successfully authenticated, but GitHub does not provide shell access.
What am I doing wrong and how do I get it to work again?