What causes Google gcloud error message "ERROR: (gcloud) Invalid choice: 'get'. Did you mean 'meta'?" mean?

4.4k views Asked by At

When I try to git push to Google cloud repository, I get the above message. It then asks me to enter my credentials. After that I get the following error:

Valid choices are [auth, components, compute, config, container, deployment-manager, dns, docker, feedback, help, info, init, meta, preview, projects, source, sql, topic, version]. fatal: Authentication failed for 'https://source.developers.google.com/p/projectname/'

Is there anything am missing?

2

There are 2 answers

3
cherba On BEST ANSWER

As git config --list shows in your setup, git credential helper points to

credential.helper=/opt/google-cloud-sdk/bin/gcloud

This appears to be incorrect. The helper should not include absolute path. You can reset it to correct value by running

$ git config credential.helper gcloud.sh

For the above to work gcloud MUST be in your PATH environment variable, as otherwise git will not be able to find git-credential-gcloud.sh. Make sure

$ which git-credential-gcloud.sh

returns path where it is located. If it does not you can run to set path

$ source /opt/google-cloud-sdk/path.bash.inc
2
CodeWizard On

Try this instead:

Go to :

https://console.developers.google.com/project/your-project-id > 
Source Code > 
Browse > 
Find this line : 

Alternatively, instead of using the Google Cloud SDK to manage your authentication, you can manually generate your Git credentials by following this link...

Click "following this link" and you can see your git password.

  • Use your gmail and git password above to clone repository.
  • Or create .netrc file at your home folder and add :

machine source.developers.google.com
login [email protected]
password ...

It will not request your password again.