2016-11-22 63 views
4

我试图将一个新的repo推送到github,并且被阻止这样做,因为git已经缓存了meatwork凭据。OSX:git:remote:用户/ repo被其他用户拒绝的权限

$ git push -u origin master 
remote: Permission to me/me.github.io.git denied to meatwork. 

经过一番周围挖,我想也许是credential.helper这个问题,所以我试图删除它咬混帐配置仍然返回osxkeychain虽然我已删除所有设置。

$ git config --system credential.helper 
$ git config --global credential.helper 
$ git config --local credential.helper 
$ git config credential.helper 
osxkeychain 
$ 

还考察了混帐凭据osxkeychain但它只是挂起

$ git credential-osxkeychain get 

所以无论如何回到原来的问题,我怎么指定或覆盖或重新设置默认的用户正在使用的推动。我检查了user.nameuser.email设置,将它们设置为正确的用户(不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 

那么,git得到meatwork凭证,以及如何阻止它。

+0

我会检查是否有任何其他SSH密钥在您的SSH代理:'SSH-添加-L' – dorian

+0

代理没有身份。 –

回答

2

好了,简单的回答我的问题多亏了一丝的第二部分,在这里找到​​

设置credential.username属性克隆库,以我想用的伎俩的用户名。

$ git config credential.username me 

现在我的推送工作!我仍然不知道肉类从哪里来。

或者,编辑.git/config并更改[remote "origin"] url=以包括[email protected]也可以使用。

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

但是在Windows OS/10中,我遇到了完全相同的问题。为了解决这个问题,我需要去Credential Manager,并且删除了我的旧用户的所有凭据。

当我运行的Git Bash的命令:

git push origin master 

我有一个屏幕,询问我的GitHub的凭据。填写登录/密码后,它就起作用了。

+0

我在Windows 7上遇到了同样的问题,我通过从Credential Manager中删除GitHub帐户的数据来修复它。 – trojek

2

同样的问题在这里,我的解决办法是在Mac上:

  1. 开放钥匙串访问应用。
  2. 搜索github.com
  3. 删除其他用户

的信息,看看它现在的作品。

我的情况是,有人用我的Mac登录到自己的Github上,和Mac记得他的名字和密码,这就是为什么权限被拒绝他的...

-

参考:Updating credentials from the OSX Keychain | Github Help

+0

我的钥匙链里没有太多东西,它看起来都很明智,而且我的账户也不是肉类,再加上没有其他人可以访问这台笔记本电脑。 –

+0

@AustinFrance听起来很奇怪! – lleiou

+0

@AustinFrance我会建议创建一个新的ssh并重新添加它,有时它只是奇怪,它不能工作。 – lleiou