Click here to Skip to main content
15,881,172 members
Articles / All Topics

Step-by-step Setup TortoiseHg for gitHub

Rate me:
Please Sign up or sign in to vote.
4.83/5 (4 votes)
30 Apr 2012MIT3 min read 32.2K   3   2
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).

Introduction

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.

Instruction

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...

    Image 1

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

    Image 2

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

    Image 3

    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.

    Image 4

    Global Settings - Edit mercurial.ini
  • Add the following lines to your configuration file:
    [extensions]
    bookmarks=
    hggit = C:\hg-git\hggit
    
    [ui]
    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 http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html. You may choose to download either PuTTYgen.exe or the entire PuTTY package (zip).

  • Execute PuTTYgen.exe:

    Image 5

    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

    Image 6

    github Account settings
  • Select "SSH Keys"

    Image 7

    github Menu
  • Click "Add SSH Key"

    Image 8

    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.

Image 9

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.

    Image 10

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

    Image 11

  • With remote repository settings set to "local", type in the following command (1)
    git+ssh://git@github.com:Code-Artist/MSChartExtension.git
    
  • 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

License

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


Written By
Technical Lead
Malaysia Malaysia
Official Page: www.codearteng.com

Comments and Discussions

 
Praisesame good info Pin
Southmountain22-Jul-23 9:50
Southmountain22-Jul-23 9:50 
GeneralMy vote of 5 Pin
b0bh00d21-Mar-17 8:23
b0bh00d21-Mar-17 8: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.