【问题标题】:VS2022 Authentication fails when pushing code to github将代码推送到github时VS2022身份验证失败
【发布时间】:2023-02-05 10:34:04
【问题描述】:

将代码推送到 github 时出现以下错误

远程:没有匿名写入访问。致命:“https://github.com/username/repo.git/”的身份验证失败

尝试通过执行以下操作解决问题,但无法解决问题

  1. 将源设置为 https://personalAccessCode@github.com/username/repo.git --> 提示使用浏览器登录、代码、令牌登录 --> 都试过了,还是不行
  2. 将源设置为 https://username:personalAccessCode@github.com/username/repo.git --> push时提示以上错误

    有人在 VS 2022 社区版上遇到过这个吗?

【问题讨论】:

    标签: github push visual-studio-2022


    【解决方案1】:

    首先,URL 不应包含您的令牌(您可以包含您的 GitHub 用户帐户名)。

    其次,VS2022 有一个integration with a Git credential helper:检查您是否设置为GCM(或GCM Core,即使是GCM Core has been replaced by GCM)。

    GCM 或 GCM core 都是带有 latest Git for Windows 的包,所以一定要使用最新的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-06-04
      • 2021-12-26
      • 2021-02-19
      • 2021-02-05
      • 2013-07-13
      • 2020-01-17
      • 2021-02-28
      相关资源
      最近更新 更多