Windows上的git clone [英] git clone on windows

查看:1014
本文介绍了Windows上的git clone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows Server 2008上安装了SSH服务器,并初始化了git repo.

I have installed an SSH server on Windows Server 2008, and initialized a git repo.

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

I'd like to clone this on my dev environment, so that I can commit and push changes.

难以弄清路径;这是我在每个示例中看到的:

Having trouble figuring out the path; here's what I see in every example:

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

那太好了,但是我不知道如何在Windows中使用它.这对我来说似乎是错误的:

That's great and all, but I don't understand how to use that for windows. This seems wrong to me:

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

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

How does the path really work in windows?

推荐答案

如果您已按照教程Program Files (x86)"可以正常工作.

If you have followed the tutorial Setting up a Msysgit Server with copSSH on Windows, I confirm your "Program Files (x86)" can work.

例如,请参见"使用ssh的Git克隆-找不到存储库":

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

您将在"

使用Openssh而不是plink.exe更容易:请参阅"

Using Openssh rather than plink.exe is easier though: see "Setting up a Git server with Windows Server 2008".

OP JohnZ 在评论中提到:

看起来像这样取决于您使用的ssh服务器.
我安装了CYGWIN,该计算机已安装了openSSH.
要克隆它,我这样做:

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上的git clone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆