remote: Permission to xxx/repos.git denied to yyy.
happens when I initially made a git repository with credential xxx and try to push a branch with credential yyy.
Setting up user
git config github.user xxx
did not work
instead, I solved by adding my local machine’s ssh key to my github account and worked.
Make public key.
Go to your github page, click (your account icon on top-right) - Settings - SSH And GPG Keys. Copy your generated key (~/.ssh/id_rsa.pub) and paste it with a title.
Retry git push again through ssh. Assuming your remote respository named, origin: