4
 git push
 remote: Permission to newGithubAccount/newGithubAccountProject.git denied to myOldGithubAccount.
 fatal: unable to access 'https://github.com/newGithubAccount/newGithubAccountProject.git/': The requested URL returned error: 403

I got the 403 error, I know it's that incorrect access was found, and the error message clearly shows me why: Because my git push was using my previous github account's credentials, however, I've updated my git global config and generated new .ssh/id_rsa and added the ssh key into my new github account. But still this error persists, I've searched extensively on this site and on Github.help page, but still no luck, please help.

I think I need to somehow completely clear my cache for the previous github account or delete it, then I could access github with my new account. Or else ways, please advise! Thanks a lot!

1 Answer 1

1

The previous remote is configured to use the HTTP protocol. You can use the set-url remote command to update your remote to use the SSH based protocol.

git remote set-url origin [email protected]:newGithubAccount/newGithubAccountProject.git

https://help.github.com/articles/changing-a-remote-s-url/

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

1 Comment

Beautiful! Thanks sooooo much! :)

Your Answer

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