windows - Windows 上的 git 克隆

标签 windows git ssh

我在 Windows Server 2008 上安装了一个 SSH 服务器,并初始化了一个 git 仓库。

我想在我的开发环境中克隆它,以便我可以提交和推送更改。

找不到路径;这是我在每个示例中看到的内容:

home$ git clone ssh://myuser@server/path/to/repository

太好了,但我不明白如何将它用于 Windows。这对我来说似乎是错误的:

home$ git clone ssh://myuser@server/Program Files (x86)/Apache/Apache/htdocs/myrepo

路径在 Windows 中如何真正起作用?

最佳答案

如果您已遵循教程 Setting up a Msysgit Server with copSSH on Windows ,我确认您的“Program Files (x86)”可以工作。

例如参见 SO 答案“Git clone using ssh - can't find repository”:

git clone "ssh://steve@test:4837/Program Files (x86)/ICW/home/steve/vc/git/depo/test.git" 
          /c/dev/es/app/

您将在“How to stop git via ssh on windows from resolving the wrong path?”中找到其他路径示例。

虽然使用 Openssh 而不是 plink.exe 更容易:请参阅“Setting up a Git server with Windows Server 2008”。

作为OP JohnZ评论中提到:

Looks like this depends a little bit on the ssh server you use.
I installed CYGWIN, which has openSSH installed.
To clone it, I did this:

git clone "ssh://root@192.168.1.1/cygdrive/c/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/myrepofolder"

关于windows - Windows 上的 git 克隆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8050338/

相关文章:

linux - SSH 隧道、端口转发和服务

ubuntu - 当我在本地运行命令时未加载 ssh-agent

c++ - Windows 7 中的 TCP 窗口缩放

windows - GlobalMemoryStatusEx/GetPerformanceInfo - 获取实际页面文件大小、已用页面文件和可用页面文件

Windows 虚拟鼠标驱动程序

linux - 从终端自动化浏览器

git - 如何为版本控制的 git commit 命令配置选项

git:在子目录中放置一个分支

git - 在 Jenkins 构建失败之前 merge ,但不应该

php - 使用php通过ssh备份mysql数据库