Installing Mercurial on Unix (Mac/Linux/Cygwin)

NOTE: This is a fork of the tutorial with some URLs and ports replaced with those specific to the Amsterdam Fab Lab. We're running an on-line Mercurial server and some settings are different. The goal is to make things less confusing instead of more; hopefully this tutorial achieves the former.

ALSO NOTE: Once you've set up your keys and configured Mercurial, you can skip to step 6.

Mercurial is a free, distributed source control management tool. This tutorial covers how to install Mercurial on the Mac OS and clone the Fab Academy archive.

Step 1: Install Mercurial

On windows you will need to install Cygwin instead, mercurial is a part of it but needs to be explicitly selected during installation, along with "openssh" and "nano".

Step 2: Key files

You need to put the two key files (mercurial and mercurial.pub) where Mercurial (SSH actually) can find them.

Download the keys that your instructor sent you in an email.
They are named "mercurial" and "mercurial.pub".
You will need to place them in the keys directory.
To do this, save the key files to your desktop (for example) from the email.

To save the file:
- press [control]+O to save the file (then the enter key)
- press [control]+X to exit the editor

Note: Do not add any extension to the file.

Step 5: Edit the Mercurial Configuration File

Now you need to edit your personal mercurial configuration file.

Type:

nano ~/.hgrc

A text editor will open inside of the terminal window.

Add the following text to the file:

[ui]
username = First Last <[email protected]>

Change the First and Last Name to your first and last name.

Change the "<[email protected]>" text to your email address.

To save the file:
- press [control]+O to save the file (then the enter key)
- press [control]+X to exit the editor

Step 6 Clone the Archive

For convenience, we will clone it to the desktop. So we'll need to move there first (or anywhere else where you want your clone)

Type:

cd ~/Desktop

Now we're ready to obtain our very own clone of the archive, let's start with the tutorials archive

Type:

hg clone ssh://mercurial/academy.2015.tutorials

If you are cloning for the first time, you may be told that the "authenticity of the host cannot be established" and are given the option to type "yes" or "no".

The authenticity of host 'penemue.zaerc.com (82.94.213.60)' can't be established.
RSA key fingerprint is 2a:ca:4d:c5:81:95:e6:f7:9b:b8:af:2d:21:ba:55:b3.
Are you sure you want to continue connecting (yes/no)? yes
remote: Warning: Permanently added 'penemue.zaerc.com,82.94.213.60' (RSA) to the
list of known hosts.

Type "yes"

You should see the following (at least similar) response in the terminal as the archive is cloned.