2

Im trying to clone my cloud repository to a local git repository I run the

gcloud auth login

but when running

gcloud init cognitusonlinecourses

enter image description here

any help would be appreciated !

Ahmad Hijazi
  • 505
  • 2
  • 6
  • 21

2 Answers2

2

If C:\Program Files\Google\GCloud is in your %PATH%, a better course of action would be:

 cd c:\my\path\to\en\empty\folder
 gcloud init cognitusonlinecourses

That would avoid trying to do operations directly in C:\Program Files\Google\GCloud.

The OP Ahmad Hijazi confirms in the comments that trying the same command outside of C:\Program Files works.
But it requires Git: see this answer.

Community
  • 1
  • 1
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • I changed the path to an empty folder C:\Program Files\Google\empty but the same error.. – Ahmad Hijazi Aug 16 '15 at 15:57
  • @AhmadHijazi could you please use a path which is *not* in `C:\Program Files`? Like `c:\test\` Create it the folder first. – VonC Aug 16 '15 at 15:59
  • aha okay worked ! But another error appears , they are telling me that ERROR:cannot find git . please install git and try again . And already I installed it , maybe there is something to do after installing it?! – Ahmad Hijazi Aug 16 '15 at 16:04
  • @AhmadHijazi yes, uncompress https://github.com/git-for-windows/git/releases/download/v2.4.6.windows.1/PortableGit-2.4.6-5th-release-candidate-64-bit.7z.exe in C:\Git (create C:\Git first), and add C:\Git\bin to your PATH. (http://stackoverflow.com/a/9546345/6309) – VonC Aug 16 '15 at 16:05
  • when I added it ( set PATH=C:\Git\bin ) then after executing the command gcloud init cognitusonlinecourses ; the result is 'gcloud' is not recognized as an internal .. – Ahmad Hijazi Aug 16 '15 at 16:44
  • @AhmadHijazi Sure: ad gcloud in your PATH as well (that is add `C:\Program Files\Google\cloud SDK` to your PATH) – VonC Aug 16 '15 at 16:58
  • its not workingggg, im very sry PLEASE CHECK THE PHOTO I EDITED IN MY QUESTION , and tell me which command must I type! – Ahmad Hijazi Aug 16 '15 at 17:10
  • @AhmadHijazi that is because you replace the *entire* PATH with gcloud and git. See http://stackoverflow.com/a/9546345/6309: you are supposed to add to your PATH, not replace it. Try to do so in a new CMD windows. – VonC Aug 16 '15 at 17:13
  • worked thank you , still when I'm pushing to Cloud Repository using : git push -u origin master /// the result is : src refspec master does not match any. ? – Ahmad Hijazi Aug 16 '15 at 17:31
  • @AhmadHijazi that would be best presented in a new question. – VonC Aug 16 '15 at 17:43
0

Typically gcloud installation paths end with \bin. I don't know exactly how gcloud is installed in your machine, but I would expect something like the following to work:

set PATH=C:\Git\bin;C:\Program Files\Google\cloud sdk\google-cloud-sdk\bin

The directory you're looking for should include the file gcloud.cmd.

Jeffrey Vaughan
  • 819
  • 4
  • 11