Mercurial is a free, distributed source control management tool. It efficiently handles projects of any size and offers an easy and intuitive interface.
You need to Install .ssh to communicate with the MIT server in order to clone and communicate with the shared archive. Type:
You need to put key files (academy and academy.pub) where Mercurial can find them.
You will be in your home directory by default. Your prompt with look like:
Where "YourUsername" is the username you created to login to Ubuntu.
Type the following text into the terminal after the prompt:
sudo ls ~/.ssh
You system will ask you for a password - type in the password you use to log in to Ubuntu.
Note: If the system responds with a message like: ls: cannot access /home/akaziuna/.ssh: No such file or directory, then you need to create the .ssh folder. If you do not get this message, skip the command below.
sudo mkdir ~/.ssh
Within the .ssh directory you need to create another directory called keys. To do this type:
sudo mkdir ~/.ssh/keys
Download the keys that your instructor sent you in an email. They are named academy and academy.pub. You will need to place them in the keys directory. To do this, save the key files to your desktop from the email.
Change your location in the terminal by moving to the Desktop folder.
Your prompt should now look like: YourUsername@ubuntu:~/Desktop$
You need to move both of the keys from your desktop to the keys directory that you created earlier.
sudo mv academy ~/.ssh/keysThen type:
sudo mv academy.pub ~/.ssh/keys
You need to set permissions for your private key so that only you have read/write access to them.
sudo chmod go-rw ~/.ssh/keys/academyThen type:
sudo chmod go-rw-r--r-- ~/.ssh/keys/academy.pub
You will need to set the port that ssh uses to access fab.cba.mit.edu. You can do this by creating and editing a config file within your .ssh directory.
A file named config has been created on the desktop. Now we need to edit the file. This file should not have any extension.
sudo gedit config
A text editor will open outside of terminal.. Add the following text to the text editor in the terminal window:
host fab.cba.mit.edu port 846
Save the file. Do not add any extension to the file.
Now we need to move it to the .ssh directory.
sudo mv config ~/.ssh/keys
Now we need to clone the archive. For convenience, we will clone it to the desktop.
Copy the text and paste it into the terminal:
hg clone -e "ssh -p 846 -i ~/.ssh/keys/academy" ssh://firstname.lastname@example.org/academy.2013 academy.2013
You should see the following response from the terminal as the archive is cloned. Success!
requesting all changes adding changesets adding manifests adding file changes added 50 changesets with 141 changes to 101 files updating to branch default 89 files updated, 0 files merged, 0 files removed, 0 files unresolved remote: buffer_get_ret: trying to get more bytes 4 than in buffer 0 remote: buffer_get_string_ret: cannot extract length remote: key_from_blob: can't read key type remote: key_read: key_from_blob remote: failedNote: The number of files listed varies with the number of files in archive. A folder named academy.2013 has been created on your desktop. This folder contains the archive.
Now you need to edit your archive's personal configuration file. To do this you need to move into the archive folder that you just created on the desktop. It is called academy.2013
You are now within the academy.2013 directory. Your path should change to : YourUsername@ubuntu:~/Desktop/academy.2013$
To edit your archive's personal configuration file (called hgrc) to reflect your name and email we need to open the file in a editior:
sudo gedit .hg/hgrc
A text editor will open outside of the terminal window. This text should already be in the file:
default = ssh://email@example.com/academy.2013
Note: Do not change this text, just add to it - see step 5.
Put the following text in the file. Change the First and Last Name to your first and last name. Change the "<firstname.lastname@example.org>" text to your email address. Save the file. Do not add an extension.
[ui] username = First Last <email@example.com> ssh = ssh -p 846 -i ~/.ssh/keys/academy -C [hooks] changegroup = hg update >&2
Now try updating your archive by typing:
you should see a response like this:
searching for changes no changes found remote: buffer_get_ret: trying to get more bytes 4 than in buffer 0 remote: buffer_get_string_ret: cannot extract length remote: key_from_blob: can't read key type remote: key_read: key_from_blob remote: failed
If you are asked for a password, then Mecurial can't find the keys or the key file permissions are wrong. (see steps 2 & 3).
If it says something about port 22, then you forgot to update the config file. (see step 4)
To get all changes from the MIT repository into your repository:
To add new files
To commit changes
hg commit -m 'MESSAGE'
To push files to server - Never force push!
Tutorial by Anna Kaziunas France - Fab Academy AS220 Providence, RI - March 2012