Click here to Skip to main content
Click here to Skip to main content
Technical Blog

Tagged as

Step-by-step Setup TortoiseHg for gitHub

, 30 Apr 2012 MIT
Rate this:
Please Sign up or sign in to vote.
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). IntroductionThere are few articles around the web with the same topics.  http://jamesmckay.net/2010/06/tortoisehg-a

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.  http://jamesmckay.net/2010/06/tortoisehg-as-a-github-client-on-windows/ https://gist.github.com/1568668 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 documents to include some steps with additional screen shots.

Instruction

1. Install TortoiseHg

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)
  • Source       : http://bitbucket.org/durin42/hg-git
  • Destination: c:\hg-git

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 access from File > Settings
  • Click "Edit File" button in "Global Settings" tab.

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

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 prompt 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)
 
  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

Share

About the Author

Code Artist
Software Developer (Senior)
Malaysia Malaysia

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.1411023.1 | Last Updated 30 Apr 2012
Article Copyright 2012 by Code Artist
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid