2016-08-04 47 views
0

同步時在GitHub上桌面的存儲庫與gcloud source repos clone <repository>克隆以下錯誤出現在Mac OS X 10.11(酋長):使用與gcloud源回購克隆一個倉庫找不到credential-gcloud.sh

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) 

回答

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 

解決的具體存儲庫中的問題。