Bitbucket with Mercurial on Mac, TortoiseHg on Windows

Continued from part 1.

Like TortoiseHg, MacHg is a nice GUI which has a self contained Mercurial installation. Unfortunately TortoiseHg uses a different SSH key pair format to other SSH clients, this guide will allow you to use the same SSH key pairs on Mac and Windows.

  1. Download MacHg.
  2. Open your private key (yourkey.ppk) from Step 5 in PuTTYgen. Click the Conversions menu and select "Export OpenSSH key", give it different name e.g. yourkey-mac.
  3. Copy yourkey-mac to ~/.ssh/ (create the .ssh directory if it does not exist).
  4. Fix the permissions by running this command from your terminal:
    chmod 600 ~/.ssh/yourkey-mac
  5. Open MacHg. From the MacHg menu select Perferences. Click the advanced tab. Under "Mercurial Configuration" click the first Edit button. Under the UI section modify the SSH line so it points to your private key (yourkey-mac)
    ssh = ssh -i ~/.ssh/yourkey-mac -C
    Save the file and close the preferences window.
  6. Clone your repository: ssh://This email address is being protected from spambots. You need JavaScript enabled to view it./YourUserName/YourRepositoryName.
  7. Hopefully everything worked.