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

匆匆过客 提交于 2019-12-10 19:56:52

问题


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?


回答1:


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:


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 your-email@gmail.com
password ...

It will not request your password again.



来源:https://stackoverflow.com/questions/35386178/what-causes-google-gcloud-error-message-error-gcloud-invalid-choice-get

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!