richzilla
richzilla

Reputation: 41992

Connect to mercurial via ssh on windows

Can anyone point me in the direction of a simple step by step guide as to how to connect to a mercurial repo via ssh on windows. Im really struggling to get my head around it, and so far i jus keep getting a string of errors. Any help would be appreciated.

Upvotes: 2

Views: 750

Answers (2)

sonjz
sonjz

Reputation: 5090

Assumes: you have a putty suite installed, a ppk and using TortoiseHg.

Here is my original c:\somerepo\.hg\hgrc file:

[paths]
default = ssh://[email protected]/someuser/somerepo

So what's happening with ssh? Let's debug a pull statement, hg pull --debug on the command-line. I noticed it is running C:\Program Files\TortoiseHg\lib\TortoisePlink.exe instead of ssh to make the call:

PS C:\somerepo> hg pull --debug
pulling from ssh://[email protected]/someuser/somerepo
running "C:\Program Files\TortoiseHg\lib\TortoisePlink.exe" -ssh -2 [email protected] "hg -R someuser/somerepo serve --stdio"
sending hello command
sending between command
abort: no suitable response from remote hg!

So let's just reuse the call, add compression (yay!), non-interactive (batch) and our key:

[paths]
default = ssh://[email protected]/someuser/somerepo

[ui]
ssh = "C:\Program Files\TortoiseHg\lib\TortoisePlink.exe" -ssh -2 -C -batch -i "c:\keys\somekey.ppk"

Upvotes: 0

maid450
maid450

Reputation: 7486

take a look at this http://www.codza.com/mercurial-with-ssh-setup-on-windows

Upvotes: 2

Related Questions