gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 06:00:27 25 4
gpt4 key购买 nike

所以最近我一直在尝试建立一个 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com