4

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

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

How does the path really work in windows?

John Zumbrum
  • 2,786
  • 8
  • 36
  • 60

1 Answers1

2

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

See for instance SO answer "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/

You will find other path examples in "How to stop git via ssh on windows from resolving the wrong path?".

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

As the OP JohnZ mentions in the comments:

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"
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • So using the ssh syntax, it will automatically go to C:/? what if I want to have a repo on another drive letter? – John Zumbrum Nov 08 '11 at 13:14
  • @JohnZ: you should be able to specify that drive in the path: Example for drive '`e`': `/e/path/to/repo.git` – VonC Nov 08 '11 at 13:38
  • oh!! that's slick. very cool. Is that documented anywhere that you know of? I didn't see it in any of the like 6 tutorials I read through or the git clone man page. – John Zumbrum Nov 08 '11 at 13:50
  • @JohnZ: good question. I was looking for a definitive source of documentation on that topic. – VonC Nov 08 '11 at 14:01
  • 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" – John Zumbrum Nov 11 '11 at 12:37
  • @JohnZ: good point. I have included your comment in the answer. – VonC Nov 11 '11 at 14:58
  • Cool, thanks for all the help. Such a relief to have a little bit of assistance when I need it. – John Zumbrum Nov 11 '11 at 17:38