Search code examples
linuxgitgithubdebianshiny-server

Clone an git repo to an offline machine


I want to clone an git repo to an offline VM (Debian). I can ssh into the offline VM via my local machine (Mac) which has internet access. How can I clone a git repo to that offline VM?

Does simply scp the repo folder to the VM directory works? Like:

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

Please help.


Solution

  • You can just clone the repository in the VM from your local machine:

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

    Reference: The SSH Protocol