0

I am trying to push code from local windows to cloud source repository using cloud sdk the link i was following is

https://cloud.google.com/source-repositories/docs/authentication

when run the first command in my cloud sdk which is

gcloud init && git config --global credential.https://source.developers.google.com.helper gcloud.cmd

it got run without any issue but it did not generate .git folder in my local folder and when i run the second command that is

git remote add google https://source.developers.google.com/p/la-gcp-test/r/demo-repo

I got this error

fatal: not a git repository (or any of the parent directories): .git

All I want to do is to upload a simple index.html file from my local windows machine to cloud source repository using cloud sdk.

Nishit Kumar
  • 37
  • 2
  • 10
  • After the first command, what is the output of `ls -a` and `pwd`? It appears that you are inside the `.git` directory when you run the second command. – blackbrandt Oct 27 '21 at 10:49

1 Answers1

1

As you suspect, you're missing git init and this must have occurred before you can git remote add.

If you haven't initialized a local repo before you come upon git remote add, then just git init before you git remote add

I'm surprised the Google documentation doesn't include it.

DazWilkin
  • 32,823
  • 5
  • 47
  • 88