E23*_*235 12 git bash github single-sign-on
我是在 Github 中使用 SSO 的组织的一员。我通过 Web 访问存储库没有问题,它会将我重定向到 SSO 登录,仅此而已。
当我首先通过 Git-Bash 登录到我在 GitHub 上的个人存储库时,问题就开始了,我做了一些更改,然后我想在我的组织的存储库中进行更改。当我运行以下命令时,它告诉我我需要重新授权 OAuth Application,但我不明白如何:
$ git push --delete origin v0.1.3
remote: The `<my_company>' organization has enabled or enforced SAML SSO. To access
remote: this repository, you must re-authorize the OAuth Application `Git Credential Manager`.
fatal: unable to access 'https://github.com/<my_company>/myproj.git/': The requested URL returned error: 403
Run Code Online (Sandbox Code Playgroud)
如何重新授权登录?
我试图重新打开 Git-Bash,但它给我写了同样的错误。
jma*_*zin 74
我通过在终端中运行以下命令来使用 Github cli
gh auth login
Run Code Online (Sandbox Code Playgroud)
然后提示我重新进行身份验证,我成功了。
如果您当前尚未安装 CLI(命令行界面),可以访问https://cli.github.com/了解更多信息。有 Mac 版下载。
小智 28
对于 VSCode 用户或任何其他 IDE,您需要强制 GitHub 重新授权应用程序!
如果您随后在 VSCode 中注销并再次登录,系统应该会提示您重新授权。
小智 19
从“凭据管理器”窗口的应用程序中删除 git。然后再次拉repo。sso 身份验证应该会自动出现。
pmc*_*own 16
我的公司刚刚在一夜之间为我的 Github 组织启用了 SSO,因此运行时遇到了同样的错误git pull
。我通过以下步骤解决了这个问题。
git config --global credential.helper manager-core
git pull
并按照弹出的说明在浏览器中进行身份验证(这对我来说是使用 SSO 自动发生的)。在这些步骤之后,git 命令再次为我工作。