如何禁用git凭据osxkeychain

如何禁用git凭据osxkeychain,git,aws-cli,Git,Aws Cli,我试图设置saml2aws为AWS服务提供临时凭证,特别是Codecommit。 我已成功安装了AWS CLI和saml2aws,并获得了凭据。但当当前凭证过期时,我面临403。 经过短暂的挖掘,我发现问题出在osxkeychain 我为--本地、--全局和--系统设置了如下配置 [credential] UseHttpPath = true helper = !aws --profile saml codecommit credential-helper $@ 但是,当我运行

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

我为
--本地
--全局
--系统
设置了如下配置

[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 $@
最近的事情是,但没有帮助


有什么想法吗?

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

要查看它所在的配置文件,请运行

git config --list --show-origin
然后,您可以通过手动编辑该文件将其删除

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

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

空白的帮助程序阻止它返回到在更高级别的配置中配置的帮助程序

Worked!实际上,我在每一个级别(
--local
--global
--system
)替换了credential.helper,但是位于/Library/Developer/CommandLineTools/usr/share/git core/中的gitconfig文件似乎没有生效。现在,我手动编辑该文件以匹配上面的内容,并开始工作。非常感谢你!Woooow,其他帖子有这么多的投票,这是最好的答案:)