2017-06-01 87 views
1

我做了我的新帳戶「kim2」但是當我用「kim2」推
它提供了以下錯誤:遠程權限被拒絕的user2

kim-computer:Kaggle-A-Z kim2$ git push kim2 master 
remote: Permission to kim2/Kaggle-A-Z.git denied to kim1. 
fatal: unable to access 'https://github.com/kim/Kaggle-A-Z.git/': 
The requested URL returned error: 403 

我改變了全球user.name和全球user.email新用戶ID

我正在使用HTTPS而不是SSH。
任何解決方案?

回答

0

編輯全局user.name和葉形user.email通過編輯〜/的.gitconfig

[user] 
    email = [email protected] 
    name = yourname 

git config --global user.name "yourname" 
git config --global user.email "[email protected]" 

當你正在使用HTTPS而不是SSH,沒什麼可擔心的權威問題。

正如你不得不通過kim2提交一些補丁,你應該改變這種承諾:

git commit --amend --author="author <[email protected]>" 
1

首先,user.name/email無關使用ssh或HTTPS URL。其次,對於https url,您有一個憑證幫助程序緩存機制,它可能已緩存(並將自動重用)您的上一組憑據以推送至github.com:您需要從緩存中清除該憑證。

在mac上,這個credential helper is libsecret
請參閱「Updating credentials from the OSX Keychain

然後您將被要求在推送時輸入您的kim2 GitHub憑證,並且它們將被緩存。