Edis Golubich
Edis Golubich

Reputation: 187

Git push to google cloud compute engine

I'm new to GCP, and am trying to git push my repo to a GCP Compute Engine running Debian.

I download the gcloud command tool and ran

gcloud compute config-ssh

Which gave me as ouput ssh golub-vm.us-west1-a.golub-182114. After that I did an

gcloud compute ssh golub-vm

And created a remote bare git repo at ~/apps/golub/golub.git So I added it as a remote to my local repository via:

git remote add gsrvr [email protected]:/apps/golub/golub.git

and tried a push, but I'm getting an

D:\golub>git push gsrvr master
bash: git-receive-pack: command not found
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Note: I made sure that /apps/golub/golub.git is owned by golub:root. What am I doing wrong?

Oh and I tried to use gcloud compute scp to copy a local file to the server, it works fine, so it shouldn't be any issues with the ownership, right?

I'm running a Bitnami LAMP image. So the full path would be /opt/bitnami/apps/golub/golub.git

Upvotes: 3

Views: 1386

Answers (1)

VonC
VonC

Reputation: 1324258

Try first:

ssh -Tv [email protected]

That will show you what ssh public/private keys ssh is trying in order to open a remote secure session.

Consider that gcloud compute config-ssh is likely to create a ~/.ssh/config file, which means the ssh URL to use is not user@server but an alias seen in that file.

Each instance will be given an alias of the form NAME.ZONE.PROJECT.
For example, if example-instance resides in us-central1-a, you can SSH to it by running:

ssh example-instance.us-central1-a.MY-PROJECT

Upvotes: 2

Related Questions