0

在 Mac OS X 10.11 (El Capitan)上同步 GitHub Desktop 中克隆的存储库时gcloud source repos clone <repository>出现以下错误:

git: 'credential-gcloud.sh' is not a git command. See 'git --help'.
2016-08-04 07:44:06.598 GitHub Desktop Login[809:15686] AskPass with arguments: (
    "/Applications/GitHub Desktop.app/Contents/MacOS/GitHub Desktop Login",
    "Username for 'https://source.developers.google.com': "
)
2016-08-04 07:44:06.645 GitHub Desktop Login[809:15686] Error getting keychain item for source.developers.google.com: The specified item could not be found in the keychain.
error: unable to read askpass response from '/Applications/GitHub Desktop.app/Contents/MacOS/GitHub Desktop Login'
fatal: could not read Username for 'https://source.developers.google.com': Device not configured
 (128)
4

1 回答 1

0

原因是在 PATH 上找不到 gcloud SDK 提供的凭证助手 git-credential-gcloud.sh。

幸运的是,git 不仅可以从 PATH 调用和检测凭证助手,还可以在指定完整路径时接受和调用命令。

从以下位置更改 credential.helper:

credential.helper="gcloud.sh"

至:

credential.helper=/<PATH-TO-GCLOUD-SDK>/bin/git-credential-gcloud.sh

通过调用

git config credential.helper /<PATH-TO-GCLOUD-SDK>/bin/git-credential-gcloud.sh

解决特定存储库的问题。

于 2016-08-04T05:55:06.873 回答