2

When I set up git, I used one username/email combination.

Then I changed my username and email combination on GitHub.

Now when I try to push to my repositories i get the following error message:

Permission denied (publickey)
fatal: Could not read from remote repository.

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

I know the repository exists. So I have a feeling git is trying to communicate with gitHub using my old username and email, which obvi isn't recognized as me now.

How do I erase the stored github account info and re-authenticate in git?

1 Answer 1

1

The important part is the username: if you have change GitHub account, then you need to make sure your $HOME/.ssh/id_rsa.pub (or %USERPROFILE%\.ssh\id_rsa.pub) is registered in that new account.

The email part is not important (except for the gravatar displayed with your old commits)

Sign up to request clarification or add additional context in comments.

1 Comment

Sorry I didn't log back in for a while, but that was exactly what I did to fix it. Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.