linux - 无法从 Windows 计算机连接到 Linux git Repo

标签 linux windows git ubuntu

所以最近我一直在尝试建立一个 Git 服务器来管理个人项目和工作。我在运行 Ubuntu 的备用笔记本电脑上创建了一个裸 Git 存储库,并在 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 计算机成功从服务器克隆到自身?谢谢!

最佳答案

有效的 ssh URL 是

auser@myserver-Dell-System

您可以检查是否可以解析并连接到该服务器

ssh -T auser@myserver-Dell-System

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

关于linux - 无法从 Windows 计算机连接到 Linux git Repo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41645715/

相关文章:

git - 对文件所做的任何更改,git 都会在 .history/中创建未跟踪的文件

linux - 如何操作 awk 输出?

linux - 我如何找出我的代码在哪里导致 GLib-GObject-CRITICAL?

Linux 库代码注入(inject)和对 SO 中同名函数的调用

存储在 shell 变量中的正则表达式在双括号之间不起作用

c# - 在另一个 session 中枚举用户桌面的 Windows

.net - 适应屏幕和字体设置的 WPF 应用程序(或者,我如何将 DLU 与 WPF 中的单元相关联?)

git - 修改旧提交

windows - Lua os.execute 空终端

git - 设置 .cpanel.yml 文件上传所有内容