Git:请求的 URL 返回错误:403 |认证错误

问题描述 投票:0回答:1

完整上下文:我目前使用的是 Debian 系统,即 Pop_OS!具体来说,我最近从 Windows 10 过渡到了哪个(如果相关的话)。现在我正在做“Python 100 天”,我现在已经在 git 上成功提交了我需要的文件,但是当我将其推送到 github 时,我不小心使用了我拥有的另一个帐户登录。

所以现在当执行

git push
命令时,我得到这个:

remote: Permission to ActuallyCasealop/100-days-of-python.git denied to Casealop.
fatal: unable to access 'https://github.com/ActuallyCasealop/100-days-of-python.git/': The requested URL returned error: 403

Actuallycasealop
是预期的帐户,当提示将github连接到git时,我不小心用
casealop
登录了。我该如何纠正这个问题?

linux git github debian
1个回答
0
投票

您遇到的

403
错误表示您使用的 GitHub 凭据无权推送到
ActuallyCasealop/100-days-of-python.git
存储库。由于您不小心使用了错误的 GitHub 帐户 (
Casealop
) 进行了身份验证,因此您需要将凭据更新为正确的帐户 (
ActuallyCasealop
)。

如果您想直接更改保存的凭据,您可以使用:

git config --global credential.username "ActuallyCasealop"

更新后,下次您

git push
时,系统应该会提示您输入密码。如果启用了双因素身份验证,您还可以使用个人访问令牌代替密码。

© www.soinside.com 2019 - 2024. All rights reserved.