user6536651
user6536651

Reputation:

fatal: unable to access 'https://github.com/SOME_NAME/SOME_PROJECT.git/': The requested URL returned error: 403

 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!

Upvotes: 4

Views: 2341

Answers (1)

Ben Campbell
Ben Campbell

Reputation: 4678

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/

Upvotes: 1

Related Questions