Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从vps中克隆git_Git_Ssh_Vps - Fatal编程技术网

从vps中克隆git

从vps中克隆git,git,ssh,vps,Git,Ssh,Vps,克隆存储库时遇到一些问题 $git clone ssh://root@8x.12x.9x.21x:/repo repo Cloning into 'repo'... fatal: '/repo' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the reposi

克隆存储库时遇到一些问题

$git clone ssh://root@8x.12x.9x.21x:/repo repo
Cloning into 'repo'...
fatal: '/repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
而我在vps本身的克隆上没有这样的困难。我从另一台计算机上推到它也没有问题

$ ssh root@8x.12x.9x.21x
Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 2.6.32-042stab111.11 x86_64)

* Documentation:  https://help.ubuntu.com/
Last login: Tue Mar  8 12:29:47 2016 from 80.79.35.115
root@vps:~# ls
deployment_test  my-project  repo
root@vps:~# git clone repo repo2
Cloning into 'repo2'...
done.
有人知道可能是什么问题吗?

使用

git clone ssh://root@8x.12x.9x.21x:/root/repo
您可以省略冒号,因为您使用的是标准端口

git clone ssh://root@8x.12x.9x.21x:/root/repo
为完整起见,SSH克隆URL的工作方式与中的相同

git clone root@8x.12x.9x.21x:/root/repo
或者使用相对路径,因为它位于root的主目录中

git clone root@8x.12x.9x.21x:repo
使用

您可以省略冒号,因为您使用的是标准端口

git clone ssh://root@8x.12x.9x.21x:/root/repo
为完整起见,SSH克隆URL的工作方式与中的相同

git clone root@8x.12x.9x.21x:/root/repo
或者使用相对路径,因为它位于root的主目录中

git clone root@8x.12x.9x.21x:repo