github "Repository not found fatal: Could not read from remote repository" error, troubleshooting and fix

Yesterday I'm suddenly unable to access repos I work with on a daily basis. When I rebase or try to clone 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.

Nothing changed. My github credentials un-chanaged. My ssh keys unchanged.

I was able to fix by regenerating my ssh keys but read on for tips on troubleshooting

  • there's a good troubleshooting page on github with help on common issues
  • first, test your ssh connection and identity using `ssh -vT git@github.com`
    • see more here
    • when I ran this command I noticed it's response "Hi <id>, .." was not the id I expected and clearly a problem

  • check your `~/.gitconfig` (does it looks correct?)
  • check the email and userid used in your repo, they should be as expected and be associated with the ssh key locally and also in github
    • you can unset 
    • git config --global --unset user.name
      git config --global --unset user.email
      git config --global --unset credential.helper
In my case I don't know why this problem started, but the fix was to regenerate my ssh keys AND edit my `~/.ssh/config` file IdentityFile property value which was wrong (no longer matched the latest ssh key generation steps). Need to be: `IdentityFile ~/.ssh/id_ed25519` 
Then add the ssh key to github

Then when I re-ran `ssh -vT git@github.com` it was correct. Pain in the butt problem solved.






Comments

Popular posts from this blog

deep dive into Material UI TextField built by mui

angular js protractor e2e cheatsheet

react-router v6.4+ loaders, actions, forms and more