TortiseHg can be a bit of a pain to set up if you don't want to
have peagent running in the background all the time for
authentication. This method uses TortisePlink (comes with the install)
for authentication, and runs it only when it needs to authenticate.
Generating a public/private key pair
- Download PuTTYgen and run it.
- Generate the key pair by clicking the generate button.
- Optionally, enter a passphrase to protect the private key.
- Save the public and private keys somewhere. I prefer to save them as
C:/Users/[username]/.ssh/ but it
doesn't really matter.
Setting up TortiseHg
- Download TortiseHg and install it.
- When installing, make sure that SSH Utils are installed.
- When it finishes installing, run the program (it'll be called
"TortiseHg Workbench" in the start menu).
- Configure the settings as you see fit. This will generate a
configuration file at
- Close the program and open up
mercurial.ini in a text editor.
- Under the "[ui]" section (if it doesn't exist, create it) add/edit two
entries (adjusting for your own custom settings):
username = [name] <[email]@[domain]>
ssh = "C:\\Program Files\\TortoiseHg\\TortoisePlink.exe" -i "C:\\Users\\[username]\\.ssh\\id_rsa.ppk"
Now all that's needed is to upload the generated public key to the
server(s) you wish to pull from or push to.
When asked, just open the
key up in a text editor (make sure it's the public key, NEVER share your
private key) and copy-paste the text.
After configuring this, you'll be able to push to repositories on the
servers you give your public key to, without having to enter your password every time.