An Agreeable Procrastination – and the blog of Niels Kühnel

Code, the universe and everything

Archive for September 2010

How to use TortoiseHG as a client for Assembla’s Source/Git repository

leave a comment »

After a little struggle I have managed to use TortoiseHG as a client for an Assembla Git respository. The biggest problem was to get ssh working with the hg-git extension.

It’s really great because now I can use Mercurial (as I prefer) with Assembla. And with hg-git, the integration with Git repositories is seamless, so I will never have to think about that I’m actually sleeping with the enemy.

So, what you need to do to enjoy the same hapiness as I am is this:

1. Generate a public/private key pair to use with Assembla

Download PuTTy. You can get it from here. Choose to download all the binaries (either as zip or installer).

Use “PUTTYGEN.EXE” to create the key pair and update your profile on Assembla as described at http://www.barebonescoder.com/2010/04/assembla-git-windows-you/

Note the stuff about pageant.exe. On my computer I had to start it manually (it’s placed where you installed PuTTY). It’s pretty easy to make it start automatically with Windows. Just add a shortcut in the folder “Startup” in your start menu.

When it’s running you have to add the private key you’ve just created:

Simply click the pageant icon in the system tray (it’s a computer wearing a fedora) and choose “Add Key”. Then select your key and enter your passphrase

pageant

The pageant icon in the sytem tray on Windows 7

2. Install the hg-git extension

(from http://tortoisehg.bitbucket.org/manual/1.0/nonhg.html)

TortoiseHg Windows installers come with the python-git bindings (named dulwich) that hg-git requires, so one only needs to clone the hg-git repository to your local computer:

hg clone http://bitbucket.org/durin42/hg-git/ C:\hg-git

Then enable hggit and bookmarks in your Mercurial.ini file:

[extensions]
bookmarks =
hggit = C:\hg-git\hggit

You can verify that worked by typing hg help hggit

3. Make a copy of TortoisePlink.exe and call it “ssh.exe”

I took me a while to figure this one out. Luckily, this answer worked. Otherwise you get weird “abort: The system cannot find the file specified” errors when trying to clone the repository.

It’s easy: Simply make a copy of “C:\Program Files (x86)\TortoiseHg\TortoisePLink.exe” (or wherever you have installed TortoiseHG) and call it “ssh.exe”.

4. Use the right url for the repository. That’s not the one from Assembla.

Assembla will tell you to use an url like “git@git.assembla.com:your-space-name.git”. That doesn’t work. Instead you should use “hg clone git+ssh://git@git.assembla.com/your-space-name.git”.

5. Enjoy

That’s it. Now you can use TortoiseHG as you’re used to while pushing and pulling changes from Assembla. Neat, huh?

Advertisements

Written by niels.kuhnel

September 1, 2010 at 5:37 pm

Posted in Uncategorized

Tagged with ,