如何重新授权OAuth应用程序“GitCredentialManager”
我是在 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
如何重新授权登录?
我试图重新打开 Git-Bash,但它给我写了同样的错误。
回答
我的公司刚刚在一夜之间为我的 Github 组织启用了 SSO,因此运行时遇到了同样的错误git pull。我通过以下步骤解决了这个问题。
- 在 Windows 中打开凭据管理器并删除 github.com 的现有凭据
- 在 git bash 中重新初始化 cred 管理器:
git config --global credential.helper manager-core - 重新运行
git pull并按照弹出的说明在浏览器中进行身份验证(这对我来说是使用 SSO 自动发生的)。
在这些步骤之后,git 命令再次为我工作。
THE END
二维码