2017-06-01 51 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凭证,并且它们将被缓存。