I was able to clone a copy of this repo over HTTPS authenticated. I\'ve made some commits and want to push back out to the GitHub server. Using Cygwin on Windows 7 x64.
Same error and resolution on Mac OS X.
Everything was working fine till I created a new account on GitHub and tried to push
$ git push -u origin master
And got the error:
remote: Permission to NEWUSER/NEWREPO.git denied to OLDUSER. fatal: unable to access ‘https://github.com/NEWUSER/NEWREPO.git/': The requested URL returned error: 403
It should have fixed by setting the user.name either for global or current repo
$ git config –-global user.name NEWUSER
$ git config user.name NEWUSER
But it didn’t.
I got it fixed by deleting the OLDUSER associated with GitHub from Keychain Access app under Passwords section. Then the push command went successful.
$ git push -u origin master
reference