gpt4 book ai didi

git - 使用 gcloud 的凭证助手访问 Google 源代码库会阻止 osxkeychain 工作

转载 作者:行者123 更新时间:2023-12-03 23:37:24 25 4
gpt4 key购买 nike

Google Source Repositories docs ,它要求您使用 git config credential.helper gcloud.sh允许 Git 进行身份验证

最近,这使我无法将 osxkeychain auth 与 GitHub 一起使用 - 添加该命令后,当我尝试从 GitHub pull 数据时收到此错误消息(在唯一远程是 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.1gcloud :
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


[credential "https://source.developers.google.com"]
helper = gcloud.sh

关于git - 使用 gcloud 的凭证助手访问 Google 源代码库会阻止 osxkeychain 工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48157605/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com