【问题标题】:git push - Permission to denied - The requested URL returned error: 403git push - 拒绝的权限 - 请求的 URL 返回错误:403
【发布时间】:2019-11-05 06:23:36
【问题描述】:

和其他许多一样,当我使用 git push 时,我得到下一个错误:

remote:对 mmistakes/minimal-mistakes.git 的权限被拒绝给 MyName。 致命:无法访问'https://github.com/mmistakes/minimal-mistakes.git/':请求的URL返回错误:403

我在 Windows 中工作,我有 git 2.22。 我试过了:

  1. 在终端中运行以下两条命令,替换明显的东西:

git config --global user.name "你的名字在这里" git config --global user.email "你的邮箱地址"

  1. 这个“How can I change the user on Git Bash?”

  2. 删除 Windows 凭据

  3. 向 Github 添加 ssh 密钥

但这些都不适合我。

【问题讨论】:

  • 如果您通过 HTTPS 访问,.ssh 密钥无关紧要。如果要使用 SSH,请使用 git@github.com URL。
  • 你是使用用户名和密码推送,还是使用令牌?您是否设置了两因素身份验证?

标签: git github github-for-windows


【解决方案1】:

403 是一个被禁止的错误代码...所以只要你确定你的 git 用户名和密码是准确的,那么你必须确保你是 GitHub repo 上的授权用户检查here 以获取更多详细信息你需要什么权限。

【讨论】:

    【解决方案2】:

    除非您是 GitHub 上的 mmistakes,否则您将无法直接推送到此存储库,除非 mmistakes declares you as a collaborator。

    考虑forking mmistakes/minimal-mistakes.git,您将能够推回(HTTPS 或 SSH)到所述分叉存储库。

    【讨论】:

      猜你喜欢
      • 2022-10-24
      • 2022-12-05
      • 2016-06-20
      • 2021-11-14
      • 2016-10-30
      • 2020-04-11
      • 2019-04-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多