无法从Windows机器连接到Linux git Repo

时间:2017-01-14 01:05:17

标签: linux windows git ubuntu

所以最近我一直试图建立一个Git服务器来管理个人项目和工作。我在运行Ubuntu的备用笔记本电脑上创建了一个裸Git repo,我在我的Windows机器上安装了Git Bash。现在我在实际能够将我的Ubuntu git服务器克隆到我的Windows计算机时遇到了一些问题。

我使用git remote add origin myserver@myserver-Dell-System:/home/myserver/CentralRepo.git但是 每当我尝试克隆到我的Windows机器时,Git bash就会吐出这个错误:

ssh: Could not resolve hostname myserver@myserver-Dell-System: Name or service not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and repository exists.

我仔细检查了我的添加,以确保我的Git服务器的地址是正确的,我认为Windows的Git bash附带OpenSSH。

有谁知道为什么会这样,以及如何让我的Windows机器成功地从服务器克隆到自身?谢谢!

1 个答案:

答案 0 :(得分:0)

有效的ssh网址

auser@myserver-Dell-System

您可以使用

检查是否可以解析并连接到该服务器
ssh -T auser@myserver-Dell-System

假设您已生成公共/私有ssh密钥对,并首先将您的公钥添加到~auser/.ssh/authorized_keys文件。
请参阅“Adding SSH Keys to authorized_keys