Fatal: unable to access "https://github.com/SOME_NAME/SOME_PROJECT.git/": the requested URL returned an 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 error 403, I know that the wrong access was found, and the error message clearly shows me why: Since my git push used my previous github credentials, however, I updated the global git configuration and generated a new one .ssh/id_rsaand added the ssh key to my new github account. But this error persists, I searched this site many times on the 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, and then I could access github with my new account. Or else, please advise! Many thanks!

+4
source share
1 answer

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

git remote set-url origin git@github.com:newGithubAccount/newGithubAccountProject.git

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

+2
source

Source: https://habr.com/ru/post/1649699/


All Articles