无法将代码从Windows计算机推送到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将代码推送到远程存储库,但它显示错误如下:

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

如何纠正我的错误?

您收到此消息是因为 --全局电子邮件和名称问题。 要解决此问题,请在git push之前使用以下两个命令

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

在这里,您可以使用该电子邮件来制作您的Github帐户。您可以在 git hub sittings 选项卡中找到您的电子邮件。 现在终于使用git push在在线存储库中提交您的更改。

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

最新更新