2017-10-06 192 views
2

我是GCP的新手,並試圖將我的庫回推到運行Debian的GCP計算引擎。Git推谷歌雲計算引擎

我下載gcloud指令工具

gcloud compute config-ssh 

這給了我作爲輸出中ssh golub-vm.us-west1-a.golub-182114。 之後,我做了一個

gcloud compute ssh golub-vm 

而在~/apps/golub/golub.git創建遠程裸git倉庫所以我通過增加一條,作爲一個遙控器來我的本地庫:

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

,並試圖一推,但我m如果您的

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. 

注:我確信/apps/golub/golub.gitgolub:root所有。我究竟做錯了什麼?

哦,我試圖用gcloud compute scp將本地文件複製到服務器,它工作正常,所以它不應該與所有權的問題,對不對?

我正在運行Bitnami LAMP圖像。因此,完整的路徑將是/opt/bitnami/apps/golub/golub.git

回答

1

首先嚐試:

ssh -Tv [email protected] 

會告訴你什麼樣的ssh公鑰/私鑰SSH是爲了打開遠程安全會話嘗試。

考慮到gcloud compute config-ssh很有可能創造出一個的〜/ .ssh/config文件,這意味着SSH URL使用的是[email protected]但在文件中看到一個別名。

每個實例將被賦予一個別名,形式爲NAME.ZONE.PROJECT
例如,如果如實例駐留在us-central1-a,您可以通過運行SSH連接到它:

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

有與SSH沒有問題,我可以連接就好了通過使用Git Bash的SSH(我在Windows上)像你所要求的。我試着改變它,所以我在URL中使用服務器和用戶名:'[email protected]:/apps/golub/golub.git(push)'但我得到了同樣的錯誤。 SSH密鑰正確,我在'/ .ssh/config'中啓用了日誌,並設置了'LogLevel DEBUG3'。我嘗試了不同的道路,使用相對和絕對的方法。就像使用'/ home/golub/apps/golub/golub.git'一樣,它們都不起作用。這可能是權限問題嗎?我很確定'golub'可以RW到文件夾 –

+0

@EdisGolubich你有%USERPROFILE%\。ssh \ config'文件嗎?如果是的話,它的內容是什麼? – VonC