将 git 存储库克隆到离线计算机

Clone an git repo to an offline machine

我想将 git 存储库克隆到离线 VM (Debian)。我可以通过具有 Internet 访问权限的本地计算机 (Mac) ssh 进入离线 VM。如何将 git 存储库克隆到该离线虚拟机?

简单地将 repo 文件夹 scp 到 VM 目录是否可行?喜欢:

local_machine$ git clone https://github.com/rstudio/shiny-server.git

local_machine$ scp ~/shiny-server VM_machine:

local_machine$ ssh VM_machine:

VM_machine$ mv ~/shiny-server ~/workspace

请帮忙。

您可以 clone 本地机器上 VM 中的存储库:

VM_machine$ git clone local_machine:~/shiny-server ~/workspace

Reference: The SSH Protocol