2016-11-22 72 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