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?

RachelS
  • 68
  • 9

1 Answers1

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)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250