远程:存储库权限被拒绝。URL返回错误:403

Gan*_*uri 7 git github

可能是一个重复的问题,但所有可用的解决方案似乎都不起作用。可能是 Github 自 2021 年 8 月 13 日起更改了对密码的支持。

我已经尝试过以下方法:

  1. 检查了用户名和密码。
  2. 创建个人访问令牌。
  3. 重新检查 .git/config 文件中的原始 URL。

错误信息:

Username for 'https://github.com': gandharvsuri
Password for 'https://gandharvsuri@github.com': 
remote: Permission to gandharvsuri/gandharvsuri.github.io.git denied to gandharvsuri.
fatal: unable to access 'https://github.com/gandharvsuri/gandharvsuri.github.io.git/': The requested URL returned error: 403
Run Code Online (Sandbox Code Playgroud)

小智 25

这对我有用

\n

创建个人访问令牌时,\xe2\x9c\x85选中一些复选框,例如

\n
    \n
  1. \xe2\x9c\x85repo
  2. \n
  3. \xe2\x9c\x85工作流程
  4. \n
  5. \xe2\x9c\x85用户
  6. \n
  7. \xe2\x9c\x85write:讨论
  8. \n
  9. \xe2\x9c\x85admin:企业
  10. \n
  11. \xe2\x9c\x85admin:gpg_key
  12. \n
\n

嗯,这对我有用试试这个

\n


小智 13

首先你需要生成新的令牌

我的帐户 - 设置 - 开发者设置 - 个人访问令牌 - 生成新令牌

生成令牌后

git remote set-url origin https://<token>@github.com/<username>/<repo>
Run Code Online (Sandbox Code Playgroud)