How can I 'git clone' from another machine?

前端 未结 3 1940
耶瑟儿~
耶瑟儿~ 2020-12-12 15:56

On one machine (IP address 192.168.1.2), I create a Git repository by

$ cd /home/hap/working
$ git init
$ (add some files)
$ git add .
$ git commit -m \'Init         


        
3条回答
  •  醉话见心
    2020-12-12 16:39

    I think people are looking for this answer. The following command in the terminal wil login into the other computer and clone an existing repo. In the current path location of the terminal (so cd to the preferred location first).

    git clone username@12.345.67.891:/home/path/to/repo.git
    

    In case you do not now the IP address. Use ping to determine the ip of your server. After the IP address don't forget to use the use a : and then write the absolute path.

提交回复
热议问题