【问题标题】:What causes Google gcloud error message "ERROR: (gcloud) Invalid choice: 'get'. Did you mean 'meta'?" mean?是什么导致 Google gcloud 错误消息“错误:(gcloud)无效的选择:'get'。你的意思是'meta'吗?”意思是?
【发布时间】:2023-03-24 05:45:01
【问题描述】:

当我尝试 git push 到 Google 云存储库时,我收到了上述消息。 然后它要求我输入我的凭据。之后我收到以下错误:

有效的选择是 [auth, components, compute, config, container, 部署管理器、dns、docker、反馈、帮助、信息、init、meta、 预览、项目、源代码、sql、主题、版本]。致命:身份验证 'https://source.developers.google.com/p/projectname/' 失败

有什么遗漏吗?

【问题讨论】:

  • git config --list 有什么不寻常的表现吗?
  • 我对git不是很熟悉,但这是git config --list的输出: core.repositoryformatversion=0 core.filemode=true core.bare=false core.logallrefupdates=true credential.helper=/ opt/google-cloud-sdk/bin/gcloud remote.google.url=source.developers.google.com/p/projectidremote.google.fetch=+refs/heads/*:refs/remotes/google/* remote.bitbucket.url=username:password@bitbucket.org/username/reponame.gitremote .bitbucket.fetch=+refs/heads/*:refs/remotes/bitbucket/*

标签: git google-cloud-platform gcloud gcloud-cli google-cloud-source-repos


【解决方案1】:

正如git config --list 在您的设置中显示的那样,git credential helper 指向

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

这似乎是不正确的。助手不应包含绝对路径。您可以通过运行将其重置为正确的值

$ git config credential.helper gcloud.sh

要使上述工作gcloud 必须在您的PATH 环境变量中,否则git 将无法找到git-credential-gcloud.sh。确定

$ which git-credential-gcloud.sh

返回它所在的路径。如果没有,您可以运行设置路径

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

【讨论】:

  • 你的意思是 gcloud 必须在我的 PATH 中?
  • 是的,编辑说 gcloud 必须在 PATH 环境中。
  • 我很高兴地报告这行得通。我不知道它有什么不同。我不太喜欢在我的 PATH 中添加工具。
【解决方案2】:

试试这个:

转到:

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

或者,您可以通过点击此链接手动生成您的 Git 凭据,而不是使用 Google Cloud SDK 来管理您的身份验证...

点击“following this link”就可以看到你的git密码了。

  • 使用上面的 gmail 和 git 密码克隆存储库。
  • 或在您的主文件夹中创建.netrc 文件并添加:

机器来源.developers.google.com
登录your-email@gmail.com
密码...

它不会再次请求您的密码。

【讨论】:

  • 很抱歉,我无法看到您引用的文字。当我来到https://console.developers.google.com/code/develop/browse?project=projectid 时,我只看到简短的描述(即使用私人 Git 托管、访问简单的工具来理解您的代码等)。但我没有看到你引用的文字。在左侧面板上,我看到“源代码”、“存储库设置”和“工具和插件”。
  • @cherba 的回答解决了我的问题。不过我也赞成这个。
猜你喜欢
  • 1970-01-01
  • 2012-10-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多