2017-07-29 34 views
0

我试图从我的本地存储库提交一些更改到我的GitHub,但是当我尝试PUSH更改时,出现此错误:权限在推送更改时拒绝给用户(改变git本地帐户)

remote: Permission to vivek/abc.git denied to vivekstudent.
fatal: unable to access ' https://github.com/viveksinghggits/bethere.git/ ': The requested URL returned error: 403

我相信,因为我登录到通过其他帐户我的本地git的我得到这个错误。我如何重置设置,以便我可以将PUSH更改为远程?
被标记为可能重复的犯规其实答案解决,我这里面临的问题,这个问题是关于用来推动变化的协议,但我的问题是我想的帐户。

+0

[推到了可能的复制GIT中返回错误代码403致命:HTTP请求失败(https://stackoverflow.com/questions/7438313/pushing-to-git-returning-error-code-403-fatal-http-request-failed) –

+0

@DanLowe该答案是没有用的,在我的情况下,我认为是我配置了另一个名字(vivekstude nt)和emailid早些时候,现在我正试图'将代码压入我的另一个github帐户(viveksinghggits)。 – viveksinghggits

回答

0

首先你应该标题更改为更相关的东西,像 如何改变git的本地帐户 无论如何根据您需要更改与git的安装 第一次检查的电子邮件asosiated的电子邮件帐户的docs /帐户,您正在使用

$ git config --global user.email 
[email protected] 

然后通过

$ git config --global user.email "[email protected]" 

如果W¯¯更改蚂蚁只是一个存储库这样做忽略--global选项

+0

我已经尝试更改user.name和电子邮件,但它不工作。 – viveksinghggits

0

首先,设置您的用户名和电子邮件:

$ git config --global user.name 
$ git config --global user.email 

然后推这样的:

git push https://github.com/viveksinghggits/bethere HEAD:master 
相关问题