1

UPDATE: Google seemed to have updated the quickstart tutorial and it now tells you to use a regular git clone from github instead of the "gcloud source repos clone" command. So this should no longer be an issue.

ORIGINAL QUESTION: I'm trying to follow the default Java App Engine quick start tutorial locally on Windows 10. But when I try to clone the project it complains that it cannot find git.

"ERROR: (gcloud.source.repos.clone) Cannot find git. Please install git and try again." enter image description here

As you can see I have git (and mysql, which it seems to complain about too) installed and working just fine. I have tried to reinstall the Google Cloud SDK several times now and can't get it to work.

I just used the Google Cloud Installer. I also ran the "gcloud components update" once and its on the latest version now. I installed it under C:/Users/Leejjon/Applications/Google/CloudSDK to avoid spaces in my path to be sure.

Leejjon
  • 680
  • 2
  • 7
  • 24

1 Answers1

2

First off, you really have to use the Google Cloud SDK Shell, and not just command prompt. The installer creates a shortcut on the desktop for it. This "special" shell calls a cloud_env.bat file which seems to get the system path and adds the google cloud sdk folder to it. Git and MySQL were available in my user variables but not in my system variables, and that is probably why it complained about not being able to find them.

I have fixed the problem by adding the locations of Git and MySQL to the cloud_env.bat (which is located in the folder where you install the Google Cloud SDK)

ECHO OFF
CLS
SET PATH=C:\Users\Leejjon\Applications\Google\CloudSDK\google-cloud-sdk\bin;C:\Program Files\MySQL\MySQL Server 5.7\bin;C:\Program Files\Git\bin;C:\Program Files\Git\cmd;%PATH%;
cd C:\Users\Leejjon\Applications\Google\CloudSDK
ECHO Welcome to the Google Cloud SDK! Run "gcloud -h" to get the list of available commands.
ECHO ---
ECHO ON

I ran into login issues right after. I followed Cherba's steps: On Windows git pull and clone for Google cloud repository pops credential manager dialog box to get rid of them.

Community
  • 1
  • 1
Leejjon
  • 680
  • 2
  • 7
  • 24