Google Cloud SDK gcloud init

时间:2015-07-06 00:55:40

标签: sdk gcloud

我安装了Google Cloud SDK和Git,但是当我尝试运行gcloud init overseas-966(我的项目名称)时,收到以下错误消息:

G:\>gcloud init overseas-966
WARNING: `gcloud init` will be changing soon. To clone git repo consider using `
gcloud alpha source clone` command.
Initialized gcloud directory in [G:\overseas-966\.gcloud].
Cloning [https://source.developers.google.com/p/overseas-966/r/default] into [de
fault].
ERROR: Unable to initialize project [overseas-966], cleaning up [G:\overseas-966
].
ERROR: (gcloud.init) Cannot find git. Please install git and try again.

You can find git installers at [http://git-scm.com/downloads], or use
your favorite package manager to install it on your computer.

G:\>git --version``
git version 1.9.5.msysgit.1

从[http://git-scm.com/downloads]下载Git,Git路径在PATH环境变量中。请给我一些建议。

2 个答案:

答案 0 :(得分:1)

当gcloud尝试执行'git'时会发生此错误,并且无论出于何种原因它都会失败(不一定当git不在路径上时)。

假设您只关心克隆回购,您可以通过运行

来获得相同的结果

git clone https://source.developers.google.com/p/overseas-966/r/default --config credential.helper=gcloud.cmd

gcloud必须在你的道路上才能实现上述目标。

如果问题仍然存在,请在https://code.google.com/p/google-cloud-sdk/issues/list下提交错误,输出为gcloud info(个人信息已删除)。

答案 1 :(得分:0)

我也遇到过这个问题,但我已经完成了项目设置。

取自Google's Release Notes

  

0.9.89(2015/12/02)

     

gcloud Core

     
      
  • 更改了gcloud init git存储库克隆选项的行为。它现在将输入存储库的目标目录的路径作为输入,而不是存储库目标的父目录。
  •   

我认为这是它所指的变化。您可以通过运行gcloud components update来更新Cloud SDK组件。也许更新你的组件会解决问题。