简体   繁体   中英

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 golub@golub-vm.us-west1-a.golub-182114:/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

Try first:

ssh -Tv golub@golub-vm.us-west1-a.golub-182114

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM