【问题标题】:Unable to git clone from one folder to another in windows无法在 Windows 中从一个文件夹 git clone 到另一个文件夹
【发布时间】:2016-02-03 19:30:35
【问题描述】:

我在 C 驱动器中创建了一个裸存储库,我正在尝试通过发出以下命令(在 Windows 机器中)在 D 驱动器中克隆它

git clone Username@Ip_address_of_my_machine:C:/path_to_the_git_repo

但我无法克隆它,因为它出现了错误

"Cloning into 'git_repos'...
ssh: connect to host 192.168.0.5 port 22: Connection refused
fatal: Could not read from remote    repository.
 Please make sure you have the correct access rights and the repository exists."

我已经安装了 CopSSH 并设置了id_rsa.pub 密钥和授权密钥。 如github 中所述。

这个问题是因为我的电脑的动态 IP 地址是从服务提供商那里获得的吗?或者这里还缺少什么?

我已经在我的办公电脑上尝试了相同的设置和安装,它适用于上面的 git clone 命令,不同之处在于办公电脑有静态 IP 但@home 它是动态 IP

【问题讨论】:

  • 对于本地副本,您不需要 SSH。试试git clone C:/path_to_the_git_repo
  • ssh -vvv Username@192.168.0.5 也会失败。检查来自 ssh 服务器的日志。你的机器上有防火墙吗? ssh -vvv Username@127.0.0.1 有效吗?
  • @Jakuje 谢谢你的回复,会检查并通知你

标签: windows git ssh


【解决方案1】:

跳过 ssh 部分,因为它在同一台机器上。因此,您希望项目在 D 盘中的位置:

git clone C:/path_to_the_git_repo

【讨论】:

  • Patrick,谢谢你的回答,但你能否告诉我如何用 ssh 来做,就像我在办公室电脑上用 copssh 做的一样,一切正常,它用 git 克隆clone Username@Ip_address_of_my_machine:C:/path_to_the_git_repo ... 但是在office pc 中IP 地址是静态的,但是@my home 它是动态的,这可能是原因吗?
猜你喜欢
  • 2019-09-02
  • 2016-03-22
  • 1970-01-01
  • 2023-01-14
  • 2013-11-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多