gpt4 book ai didi

git - 如何禁用 git-credential-osxkeychain

转载 作者:太空狗 更新时间:2023-10-29 14:10:16 27 4
gpt4 key购买 nike

我正在尝试设置 saml2aws 以提供 AWS 服务的临时凭证,特别是 Codecommit。我已经成功安装了 AWS CLI 和 saml2aws 并获得了凭证。但是当当前凭证过期时,我遇到了 403。经过短暂的挖掘,我发现问题是 osxkeychain

我为 --local--global--system 设置了如下配置

[credential]
UseHttpPath = true
helper = !aws --profile saml codecommit credential-helper $@

但是,当我运行时在我的存储库中

git config -l

响应读作;

credential.helper=osxkeychain
credential.helper=!aws --profile saml codecommit credential-helper $@
credential.usehttppath=true
.
.
.
credential.helper=!aws --profile saml codecommit credential-helper $@
.
.
.
credential.usehttppath=true
credential.helper=!aws --profile saml codecommit credential-helper $@

最接近的是disable git credential-osxkeychain但没有帮助。

有什么想法吗?

最佳答案

您可以在每个配置文件中配置多个凭证助手,这解释了为什么在每个级别运行该配置命令后它仍然存在 - 您只是添加了一个新的配置行而不是替换旧的。

要查看它在哪个配置文件中,运行

git config --list --show-origin

然后您可以通过手动编辑文件将其删除。

如果您没有文件配置文件的权限,您可以手动编辑更紧凑的配置文件,如下所示:

[credential]
helper =
helper = !aws --profile saml codecommit credential-helper $@

空白助手阻止它回退到配置在更高级别配置的助手

关于git - 如何禁用 git-credential-osxkeychain,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52592118/

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