gcloud init PROJECT错误无法获取存储库URL

时间:2015-01-01 22:13:30

标签: git gcloud

我在gce控制台上创建了一个名为flint的项目。

然后我尝试在本地启动git repo https://cloud.google.com/sdk/gcloud/ 在该部分 初始化项目并设置push-to-deploy

这导致以下错误

$ gcloud init flint Initialized gcloud directory in [~/flint/.gcloud]. Unable to fetch repository URL. Guessing the URL, but if your project uses repo-sync then the cloned repository may be read-only. Cloning [https://source.developers.google.com/p/flint/r/default] into [default]. Cloning into '~/flint/default'... fatal: remote error: Repository not found. You may need to create a repository for this project using the Source Code tab at https://console.developers.google.com ERROR: Command '['git', 'clone', 'https://source.developers.google.com/p/flint/r/default', '~/flint/default', '--config', 'credential.helper=gcloud.sh']' returned non-zero exit status 128 ERROR: Unable to initialize project [flint], cleaning up [~/flint]. ERROR: (gcloud.init) Unable to initialize project [flint].

3 个答案:

答案 0 :(得分:5)

这里的问题是文档没有区分我选择的项目名称 - “flint” - 以及谷歌与之关联的“PROJECT ID”。我的项目ID类似于钾 - 愤怒-300。您可以在将PROJECT NAME和PROJECT ID列为项目表中的条目的项目表中看到这一点。

您必须将项目ID用于gcloud init。

  

gcloud init PROJECT ID

文档说

  

gcloud init PROJECT

项目名称和ID之间不明确。

答案 1 :(得分:1)

如果您使用正确的project id,则可能您使用了错误的google accountdifferent project。 为了设置正确的帐户/项目,可以使用以下命令:

gcloud auth login

您将被重定向到浏览器中的新页面,在该页面中,您必须选择其他各种电子邮件中的电子邮件地址并允许它。
然后,您将看到您选择的email address和{{ 1}}(您可以随时更改)。

您还可以使用以下命令设置帐户和项目:

default project id

您将获得默认配置以及三个更改选项。
enter image description here

您可以使用要求详细信息再次对其进行配置。

答案 2 :(得分:0)

确保您使用与gcloud auth login相关联的项目的相同电子邮件地址登录

相关问题