I am trying to push a new repo to github and am being prevented from doing so because git has cached meatwork
credentials.
$ git push -u origin master
remote: Permission to me/me.github.io.git denied to meatwork.
After some digging around, I thought maybe credential.helper was the issue, so I tried to remove it bit git config still returns osxkeychain even though I have removed all settings.
$ git config --system credential.helper
$ git config --global credential.helper
$ git config --local credential.helper
$ git config credential.helper
osxkeychain
$
Also looked at git credential-osxkeychain but it just hangs
$ git credential-osxkeychain get
So anyway back to the original problem, how do I specify or override or reset the default user being used by push. I checked the user.name
and user.email
settings and they are set to the correct user (not meatwork
).
$ git config --local user.name
$ git config --global user.name
me
$ git config --system user.name
$ git config --local user.email
$ git config --global user.email
[email protected]
$ git config --system user.email
So where is git getting meatwork
credentials from and how to I stop it.
Open the web portal and choose the project where you want to add users or groups. To choose another project, see Switch project, repository, team. Open Project settings>Repositories. To set the permissions for all Git repositories, choose Security.
my solution is (on Mac):
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With