git: 'credential-osxkeychain' 不是 git 命令。请参见 'git --help'。

7

我连接了Bitbucket,并在我的电脑上安装了Git和Sourcetree,我尝试将Sourcetree和Bitbucket连接起来,但是我无法连接两者。当我尝试克隆存储库源路径时,它会显示:

this is not a valid source path... 
git: 'credential-osxkeychain' is not a git command. See 'git --help'.

输入图像描述

就像这个错误一样

我对credential-osxkeychain文件毫无头绪,而我正在使用Windows操作系统

有人能帮我解决这个问题吗?

3个回答

5
有没有可能出现以下情况: $ git config --get credential.helper 显示的是 osxkeychain?这只适用于 OS X。
尝试查找相应的 .gitconfig 文件(可能在 $HOME 中),并删除凭据助手行。
编辑:Atlassian 也记录了此问题。请参考相关文档

他们只记录了OS X的问题和解决方案。如果OP在Windows上看到它,那么听起来不像是同样的问题。 - eis
就像我说的那样:在gitconfig中删除[credential] helper = osxkeychain这一行。 - iltempo
@iltempo 是的,它显示了osxkeychain。我该如何移除它? - anuruddhika
@iltempo 我已经删除了那一行。现在不会再显示“osxkeychain”错误,但我无法通过Sourcetree登录到Bitbucket。 - anuruddhika

4
在Windows电脑上,可以使用WinCred存储凭据。运行以下命令将Git设置为使用Windows凭据管理器:
git config --global credential.helper wincred

尝试一下 git fetch 或者 pull,然后它应该会再次提示你输入凭证并将其存储在凭证管理器中。
凭据管理器可以在控制面板中找到(搜索会指向正确的方向)。这将有助于快速删除凭据。

0

尝试将您的Git实例切换到Apple Git。这对我有用。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接