OSX: git: remote: Permission to user/repo denied to otheruser

my solution is (on Mac):

  1. Open Keychain Access app.
  2. Search for github.com
  3. Delete the information of other users

And see if it works now.

My situation is, someone has used my Mac to log into his Github, and Mac remembers his name and password, which is why permission is denied to him...


Reference: Updating credentials from the OSX Keychain | Github Help


Well, the simple answer to the second part of my question thanks to a hint found here https://git-scm.com/docs/gitcredentials

Setting the credential.username property for the cloned repository to the username I want to use did the trick.

$ git config credential.username me

And now my push works! I still don't know where meatwork is coming from though.

Alternatively, editing .git/config and changing the [remote "origin"] url= to include username@ in the URL also works.

[remote "origin"]
  url = https://[email protected]/Me/me.github.io.git