Click here to Skip to main content
13,251,556 members (79,981 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


2 bookmarked
Posted 30 Apr 2012

Step-by-step Setup TortoiseHg for gitHub

, 30 Apr 2012
Rate this:
Please Sign up or sign in to vote.
Step-by-step instruction to setup TortoiseHg

This is a step-by-step instruction to setup TortoiseHg (A GUI shell extension for Mercurial SCM) to use with github (online project hosting using git Version Control System).


There are few articles around the web with the same topics:

I was able to setup my TortoiseHg to work with github using the instruction written by James McKay. The document is very informative, but some of the steps are not written in details. Thus, I decided to write this document to include some steps with additional screen shots.


1. Install TortoiseHg

  • Download and install TortoiseHg from here.

2. Install hg-git

hg-git can be download by cloning the repository directly.

  • Start TortoiseHg workbench.
  • Select File > Clone Repository...

    Clone Repository
  • Configure clone repository dialog box. (#1)

    hg-git Clone Configuration
  • Click OK to start cloning.
  • Wait until repository cloning finished.

    Cloning Finished

3. Configure hg-git

The following steps had to be done by direct editing mercurial.ini file.

  • This file can be accessed from File > Settings
  • Click "Edit File" button in "Global Settings" tab.

    Global Settings - Edit mercurial.ini
  • Add the following lines to your configuration file:
    hggit = C:\hg-git\hggit
    ssh = "C:\Program Files\TortoiseHg\TortoisePlink.exe"

4. Create github Account

Create new account at github (if you don't have an account yet), else skip this step.

5. Create SSH Public and Private Keys

github required a SSH key in order to push repository to github.

To generate public and private SSH keys, you will need the PuTTYgen from the PuTTY package. You can get PuTTY from You may choose to download either PuTTYgen.exe or the entire PuTTY package (zip).

  • Execute PuTTYgen.exe:

    PuTTY Generator
  • Click "Generate" to generate new key (1) (Note: Move mouse in application window to generate random values)
  • Create password for your key (2) (Optional)
  • Save your private key (3)
  • Save your public key (4)

Now, you have your own pair of SSH private and public keys pair. Next, you will need to tell github your SSH public key.

6. Register SSH Public Key to github

  • Login to github
  • Select account settings

    github Account settings
  • Select "SSH Keys"

    github Menu
  • Click "Add SSH Key"

    github Add SSH Key
  • Copy SSH public key from PuTTYgen (5) then paste to Key in github. Give your key a title.

We are now ready to upload our repository to github.

7. Create New Repository in github

Before we can push our repository to github, the repository must be created. Click "Create new Repo" in github page to create new repository.

8. Upload Repository from TortoiseHg to github

  • Start Pageant in C:\Program Files\TortoiseHg\Pageant.exe
  • To load your SSH private key, right key at Peageant taskbar icon.
  • Click "Add Key", then select your SSH private key file. Note: You will be prompted for password if password is defined.

  • Select "synchronize"tab for repository that you wish to upload to github in Tortoise Hg Workbench.

  • With remote repository settings set to "local", type in the following command (1)
  • Push repository from TortoiseHg to github using the push button (2)
  • Use pull incoming changes to update repository from github (3)

That's all. Happy coding!

Version History

  • 29/04/2012 Created


This article, along with any associated source code and files, is licensed under The MIT License


About the Author

Code Artist
Technical Lead
Malaysia Malaysia
Official Page:

You may also be interested in...

Comments and Discussions

GeneralMy vote of 5 Pin
b0bh00d21-Mar-17 9:23
memberb0bh00d21-Mar-17 9:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171114.1 | Last Updated 30 Apr 2012
Article Copyright 2012 by Code Artist
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid