Mercurial with TortoiseHG
Tech Notes
So here are the steps I followed to get this working. I looked around for a complete end to end tutorial without success. So here is an amalgam of the release notes. https://bitbucket.org/tortoisehg/stable/wiki/ssh http://the.earth.li/~sgtatham/putty/0.60/htmldoc/Chapter8.html#pubkey http://the.earth.li/~sgtatham/putty/0.60/htmldoc/Chapter9.html#pageant
- Download
- Install TortoiseHG, log out and log in again.
- Launch PuttyGen and make a key.
- Press Generate
- Check SSH-2 RSA
- Number of bits : 1024
- Press `Save public key` - name the file id_rsa.pub in `My Documents`
- Press `Save private key` - name the file id_rsa.ppk ( ppk will be added by default ) in `My Documents`
- [[{"type":"media","view_mode":"media_large","fid":"420","attributes":{"class":"media-image size-full wp-image-911 alignleft","typeof":"foaf:Image","style":"","width":"250","height":"246","title":"PuttyGen","alt":"PuttyGen"}}]]
- Add the key to Pageant (the Putty agent) that will provide your keys to Tortoise on demand.
- Navigate to the Tortoise install directory. C:\Program Files\TortoiseHG\Pageant.exe
- Open Pageant. This will place Pageant in the task bar near the clock. The icon is a computer wearing a gangster hat.
- Right click the icon and choose `Add key`.
- Load the .ppk private key from disk. The first time the key is used each log on you will be prompted for your passphrase.
- [[{"type":"media","view_mode":"media_large","fid":"421","attributes":{"class":"media-image size-full wp-image-915 alignright","typeof":"foaf:Image","style":"","width":"151","height":"136","title":"pageant","alt":"pageant"}}]]
- Add the key to the server (hg host) authorized_keys file ( or authorized_keys2 )
- Right click id_rsa.pub and select Open > with Notepad
- Copy just the key - probably starts with `AA` and ends with `=`
- SSH into the server and edit ~/.ssh/authorized_keys - paste in the key on a new line and follow it with a comment - username@host is the convention
- Optionally restrict it to just running hg (mercurial)
command="hg -R [pathto]/[repo] serve --stdio" ssh-rsa AAAA1[long alphanumeric string]WFk= [username]@[host]
- To test clone a remote repository.
- Right click on the Windows desktop.
- In the Tortoise submenu choose clone.
- Add a directory name to the destination path.
- replace the source path with your remote repository path.
ssh://[username]@[remotehost]:[port]/[pathto]/[repo]
; - Press Clone. During the cloning process you can F5 the folder to check its progress.
- [[{"type":"media","view_mode":"media_large","fid":"422","attributes":{"class":"media-image size-full wp-image-916 alignleft","typeof":"foaf:Image","style":"","width":"265","height":"180","title":"Clone","alt":"Clone"}}]]