Step 1

Download and install Mercurial

http://mercurial.selenic.com

You will not see anything in your Applications folder. What you get is a set of command line tools, they all start with hg (get it...Hg-> Mercury)


Step 2

Download the two key files (academy and academy.pub) from the email Neil send us and save them in your Desktop.

If one of the files reads academy.txt, right click on this file, select “Get Info”, and under “Name & Extension” box remove the .txt extension (put the curser inside the box and just delete the extension, including the '.'). You will get a pop up window, select “Remove”.

Now you should have two files on your desktop, academy and academy.pub


Step 3

Copy the files to the ~/.ssh directory

To get to a command line, open the Terminal in Applications -> Utilities

-------------------------------Useful Commands----------------------------------

Type 'pwd' (print working directory) after the $, so:

pwd <enter>

you will get this response

/Users/your username.

You always start in your home directory.

Type:

ls <enter>

this command lists everything in that directory

To move up one level, type:

cd .. <enter>

(cd is "change directory," the '..' means the directory one level up).

To go into a specific directory in the one you are in, type

cd <name of directory> <enter>

To go to any directory regardless of where you are, you have to type the path, for example:

cd /Users/username>/Desktop <enter>

----------------------------------------------------------------------------------------------

Check if you have the .ssh directory

cd ~/ <enter> (go back to your home directory)

ls -a <enter> (the -a lets you see all hidden files)

If you don't see .ssh listed, you need to make one using the make directory command:

mkdir .ssh


Now you can copy the key files into your .ssh directory. The command to copy a file is "cp" and it takes two arguments, the file to copy and the place to copy it to.

For example:

cp /Users/<your username>/Desktop/academy ~/.ssh

Type:

cp Desktop/academy .ssh

cp Desktop/academy.pub .ssh

if you get the error message: Permission Denied

Type;

defaults write com.apple.finder AppleShowAllFiles TRUE <enter>

killall Finder <enter>

this will give you access to the hidden files. Files that start with '.' .

Alternatively you can copy and paste the academy and academy.pub files into the .ssh folder using the GUI.


Step 4

Edit the config file in ~/.ssh

This instruction is about editing the config file in .ssh to change the port to connect to ssh (ssh is a way of securely connecting to a remote directory used here to get the files for the class under Mercurial version control).

To create and edit that file. Go to Applications and run the Text application.

Now type these two lines:


host fab.cba.mit.edu

port 846


Save the file as config inside the .ssh folder.

Go back to the command promt, navigate to the ~/.ssh directory and make sure there is a file called config there.


Step 5

Change permissions on the academy key file

sudo chmod 600 ~/.ssh/academy <enter>

The sudo command makes that command run with administrator privileges.

chmod changes the permissions on the file, in this case the academy file.

This is done so that nobody but your user can see the private key (and so that it actually looks like a private key to the ssh command, otherwise it will complain when you do the next step).


Step 6

Clone repository

Before running this command, use

cd to go to a directory where you want all the files to end up!

For example I put mine in ~/Desktop/FabAcademy but yours could be anywhere you want it.

Now run:

hg clone -e "ssh -p 846 -i ~/.ssh/keys/academy" ssh://hg@fab.cba.mit.edu/academy Archive

You should now have a folder named 'Archive' in your computer and 2 folders inside of it. .hg and web. (You might not be able to see .hg, since it is a hidden folder, but you should be able to see the web folder)


Step 7

Edit repository configuration file


Navigate to the Archive folder.

Open the .hg folder

right click on file hgrc

click on Open With and choose textedit

This will open it in TextEdit and you can edit it directly, then use the GUI menus to save and close the file.


Append (don't replace what's already in there) all this to the file (remember to add your name and email address:

[ui]

username = First Last <user@machine.domain>

ssh = ssh -i ~/.ssh/keys/academy -C


[extensions]

convert =

fetch =


[hooks]

changegroup = hg update >&2


then save and close.


Step 8

Add your directory and class page.

Cd <path where you put the cloned directory>/Archive

mkdir firstname.lastname

cd firstname.lastname

vim index.html


Type something (doesn't matter what for now but eventually will be html for your class page) into the index page file and then save and close the file as in the vim instructions earlier.



STEP 9

Add the file to version control, commit and push your changes.

hg pull

hg add .

hg commit -m "write a comment that will help you and others know what you just commited"

hg push


Credits: this tutorial is a collection of other people's efforts. Thank you all!