简体   繁体   中英

Cannot clone from gcloud to git: “Could not find gcloud's git credential helper.”

I've got a git repository in Google's Cloud Platform. I'm trying to clone it into a local git report like this:

git config credential.helper gcloud.sh
gcloud source repos clone myrepository --project=myprojectid

It's giving me this error:

ERROR: (gcloud.source.repos.clone) Could not find gcloud's git credential helper. Please make sure the Cloud SDK bi
n folder is in PATH.

I've verified that gcloud is in $PATH:

> which gcloud
/usr/bin/gcloud

This is a new GCE instance of SUSE. Works on mac but not on this SUSE server.

Any ideas?

The Cloud SDK's bin folder needs to be in $PATH , not just gcloud .

/usr/bin/gcloud is likely either a symlink or a wrapper script that points to a full, google-cloud-sdk installation directory. You need to add google-cloud-sdk/bin to your path, since that's where the credential helper is.

(This is due to a limitation in the git-credential-helper model.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM