使用 gcloud 的凭据助手访问 Google 源存储库会阻止 osxkeychain 工作

2024-04-19

In the Google 源代码存储库文档 https://cloud.google.com/source-repositories/docs/adding-repositories-as-remotes,它要求你使用git config credential.helper gcloud.sh允许 Git 进行身份验证

最近,这阻止了我在 GitHub 上使用 osxkeychain auth - 添加该命令后,当我尝试从 GitHub 拉取时(在唯一的遥控器是 GitHub 遥控器的存储库上),我收到此错误消息:

git pull 

remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/[].git/'

请注意,它甚至不会再次询问我的用户名和密码;它立即拒绝连接

如果我从 git config 中删除 gcloud credential.helper,我可以使用 GitHub 重新进行身份验证(尽管需要再次输入我的用户名和密码)

我在用着git version 2.15.1 and gcloud:

Google Cloud SDK 183.0.0
alpha 2017.09.15
beta 2017.09.15
bq 2.0.27
container-builder-local
core 2017.12.08
datalab 20171003
gcloud
gsutil 4.28
kubectl

这里的问题是这些指令会覆盖可能存在的现有凭证助手。要将凭证助手限制为仅适用于 Google 源存储库,请运行:

git config credential.'https://source.developers.google.com'.helper gcloud.sh

或更改您的 .git/config

[credential]
        helper = gcloud.sh

to

[credential "https://source.developers.google.com"]
        helper = gcloud.sh
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

使用 gcloud 的凭据助手访问 Google 源存储库会阻止 osxkeychain 工作 的相关文章

随机推荐