无法将代码从Windows计算机推送到git存储库

时间:2018-09-05 21:38:05

标签: git

我创建了一个GitHub帐户,然后创建了一个名为who-dare-wins的存储库。然后在命令提示符下,使用git clone https://github.com/MidhuCherian/who-dare-wins.git克隆。之后,我使用git add .添加文件,然后使用git commit -m "commit"提交。然后,我尝试使用git push -u origin master将代码推送到远程存储库,但显示错误如下:< / p>

remote: Permission to MidhuCherian/who-dare-wins.git denied to MidhuJames.
fatal: unable to access 'https://github.com/MidhuCherian/who-dare-wins.git/': The requested URL returned error: 403

如何纠正我的错误?

1 个答案:

答案 0 :(得分:0)

由于--global电子邮件和名称问题,您收到此消息。要解决此问题,请在git push之前使用下面给出的以下两个命令

git config --global user.name Your Name
git config --global user.email yourmail@gmail.com 

此处是您用来建立Github帐户的电子邮件。您可以在git hub开会标签中找到您的电子邮件。
现在最终使用git push在在线存储库中提交您的更改。

如果仍然失败并出现 403错误,则应使用 SSH shell命令)将数据推送到GitHub