Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.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
如何通过ssh连接到git服务器_Git_Ssh - Fatal编程技术网

如何通过ssh连接到git服务器

如何通过ssh连接到git服务器,git,ssh,Git,Ssh,我有一个Linux机器服务器,它在域中,连接在局域网中,我的计算机上有一个centos7虚拟机,它不在域中,我想通过局域网连接到Linux机器服务器,并用ssh命令推送我的git。但我不能。有什么解决办法吗 $ git clone ssh://git@10.100.184.17:22/hostextera.git Error : does not appear to be a git repository fatal: Could not read from remote reposito

我有一个Linux机器服务器,它在域中,连接在局域网中,我的计算机上有一个centos7虚拟机,它不在域中,我想通过局域网连接到Linux机器服务器,并用ssh命令推送我的git。但我不能。有什么解决办法吗

$ git clone ssh://git@10.100.184.17:22/hostextera.git 
Error :  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.

步骤1:检查您是否可以使用此
git
用户帐户通过ssh连接到该linux计算机:

ssh git@10.100.184.17
步骤2:linux服务器上的
hostextera
存储库是一个常规目录,您应该提供一个正确指向该目录的路径

# either a relative one :
#   the part after the '/' will be relative to the home directory of the
#   `git` user home directory :
git clone ssh://git@10.100.184.17:22/repos/hostextera.git

# or an absolute one :
git clone ssh://git@10.100.184.17:22//usr/share/repos/hostextera.git


# as @pygeek pointed out, 22 is the default ssh port, you can use shorter urls :
git clone git@10.100.184.17:repos/hostextera.git
git clone git@10.100.184.17:/usr/share/repos/hostextera.git

您需要检查正在使用的git用户在git控制台上的权限。如果您可以从本地PC访问Git服务器上的任何其他存储库。

ssh暗示的端口22://。此外,请确保存储库存在于该路径上,并且可以访问ip。是否确实要连接到centos虚拟机?还是只连接到主机?