git - git clone 不工作并出现错误“要访问此存储库,您必须使用带有个人访问令牌的 HTTPS 远程或带有 SSH 密钥的 SSH”
问题描述
尝试运行命令时 Git 抛出以下错误
git clone <<clone url>>:
remote: this repository, you must use the HTTPS remote with a personal access token
remote: or SSH with an SSH key and passphrase
remote: that has been authorized for this organization. Visit
remote: https://docs.github.com/articles/authenticating-to-a-github-organization-with-saml-single-sign-on/ for more information. The requested URL returned error: 403
如错误中所述,我浏览了 url- https://docs.github.com/articles/authenticating-to-a-github-organization-with-saml-single-sign-on/,并按照步骤进行了配置SSL 授权。
此外,我按照以下 url 生成新的 SSH 密钥并存储在 SSH 代理中的步骤:https ://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh /generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent。
另外,我已经配置了个人访问令牌。下面是截图:
尽管如此,我还是遇到了与上述相同的错误。
如果需要更多信息,请告诉我。
解决方案
检查一下,对于您的 SSH 密钥,您是否拥有(如此处):
- 启用 SSO
- 授权您的组织
然后再试一次,使用 SSH URL
git clone git@github.com:<organization>/<repo>
推荐阅读
- powershell - 用前导 0 填充 IP 地址 - powershell
- r - 如何选择在 R 中的数据表列中只出现一次的值?
- php - 调用未定义的方法 Illuminate\Support\Facades\Auth::user()
- video.js - VideoJS 播放器显示 VOD 流的 LIVE 模式
- php - nopriv 操作在未登录时不起作用
- swift - RealityKit arView.snapshot 失败
- rest - 使用自定义标头和表单数据创建 WebApi
- c++ - 无法在 CMake 中创建动态库并将其链接到另一个动态库?
- mysql - 使用 mariadb 10.4.8 docker 容器的用户“root”@“localhost”的访问被拒绝,使用 docker compose 并在附加外部卷时发出问题
- spring - 调用 Google Cloud Datastore 的 Tasklet 或 ItemReader