Beginner’s Guide to Setting up Mercurial on Windows and Cloning a Repository

Introduction

At Yahara Software, we have standardized on using Mercurial as our source control management tool.  This blog post is a set of basic instructions for installing the tools and getting code from a Mercurial repository, hosted on HTTP.

"Cloning" is the act of copying the contents of a remote Mercurial repository (set of source code and change history) to your local machine.

A comprehensive (and great) introduction to Mercurial can be found at Joel Spolsky's HG Init site.

Step 1: Install TortoiseHg

TortoiseHg is a Windows shell extension (hence “Tortise”) and client application that makes it easy to interoperate with Mercurial repositories.  TheTortoiseHg application comes in 32 and 64-bit versions, and is available from http://tortoisehg.bitbucket.org/.  The programs are lightweight, just take thedefaults when installing it.

The installer will install everything you need:

  1. Mercurial – the core program and associated files
  2. The TortiseHg shell extension that extends Windows Explorer so you can do right-click Mercurial operations in Windows
  3. TortoiseHg Workbench – a Windows application that can be used to manage source code

Step 2: Find Your Repository URL

Locate the repository URL that you wish to clone.  This is the HTTP or file path to the remote repository.  It may look something like this:

  • HTTP: https://www.myurl.com/hgweb.cgi/Source/myRepository/
  • File System: E:\Repositories\myRepository

Step 3: Clone the Repository

1. Create a new folder in Windows Explorer where you will want to store your code

 

2. Right-click the folder and pick “TortoiseHg/Clone”



3. Paste the URL for your repository into the “Clone” dialog, and click the “Clone” button



4. You will be prompted to enter your username and password – use the same credentials you use to log into the portal site
5. The code will be downloaded and placed in the folder, and is now tracked by Mercurial

 

 

No Comments