I do this tutorial for the people who use Win OS. All the previous tutorials are for Linux based OS or for Mac. So I hope that tutorial could be usefull.
Installation
The process has 4 steps basically: (1) The Cygwin installation, (2) the SSH configuration, (3) the mercurial clonation in Cygwin platform, and (4) the TortoiseHg instalation optional).
Step 1: Cygwin Installation |
- First download the Cygwin Setup [download].
- Then procced to install the cygwin, when the installer ask you for the Download Sourse, choose the first option ("Install from internet").
- Choose the installation directory (the default is "C:/cygwin")
- Change the Local package directory to the same install directory of the Cygwin.
- Then procede with the installation, when you reach the Package Selection step you need to install 3 packages:
- Search "mercurial", then open Python branch (click on box), and after click on skip (the version number will apear).
- Search "openssh", then open Net branch and click on skip.
- Search "nano" (is text editor I used for this tutorial), open "Editors" branch and click on .
- Then click "Next" button and accept resolve all the package dependencies
- Finally click "Next" and wait the download of the program and their the packages.
Step 2: SSH Configuration |
- Open the System propeties (or press [Win-key] + [Pause]) and go to Advanced tab.
- Then create a new System Variable (click in )
- In the window opened write in Variable name:
Cygwin
and in Variable value:ntsec
then . - Then in System Variable table, look for "Path" variable and modify it (click in ).
- In Variable Value: add at the end ";c:\cygwin\bin", accept and close all the windows and thats all.
Step 3: Cloning with Mercurial |
- Open the Cygwin Bash Shell.
- Create a folder called ".ssh" inside the "~" folder, you can type in Cygwin:
mkdir .ssh [Enter]
- Then create a folder called "keys" inside the ".ssh" folder, you can type:
mkdir .ssh/keys [Enter]
- Copy the key files (academy & academy.pub) to the keys folder.
- Now change the mode of the academy file to only read&write, type in Cygwin:
chmod 600 .ssh/keys/academy [Enter]
- Now we need to create the config file using Nano text editor, so type:
nano [Enter]
Inside nano write:host fab.cba.mit.edu [Enter] port 846 [Enter]
- To exit press [Ctrl]+[X] then press [Y] to save the file, save as config [Enter]
- Chose the folder where you want to create your cloned repository browsing with the Cygwin. Personally I prefer to clone closed to the home of the Cygwin (the folder where the cygwin start when you open it).
- Then type:
hg clone -e "ssh -p 846 -i ~/.ssh/keys/academy" ssh://hg@fab.cba.mit.edu/academy FabLab [Enter]
(the last word of the code is the name of the folder of the clonation) - Wait for the download (could take several hours, depending of your internet connection). When the clonation is complete (you will notice your cloned file will no increse his sise)
- Now I need to modificate the "hgrc" file inside the ".hg" folder (that folder was create inside the clonated folder) to modify open it and type:
nano hgrc [Enter]
(of course yo need to locate the folder with the cygwin navigator if you want to open using this code) - Inside the nano add:
- To exit press [Ctrl]+[X] then press [Y] and [Enter] to save the file with the same name.
[ui] [Enter] Username = Your Name <your_e-mail@server.ext> [Enter] ssh = ssh –p 846 –i ~/.ssh/keys/academy –C [Enter] editor = nano [Enter] [hooks] [Enter] changegroup = hg update >&2 [Enter]
That's all. Now you can upload your files. Check the "Mercurial Notes" [Link]
Step 4: TortoiseHg Installation |
Why I tell it's optional?, because the clonation, pulling, pushing, adding, etc, etc, etc of Mercurial, doesn't need TortoiseHg to function. The tortoiseHg is a graphical interfase for the Mercurial.
Without TortoiseHG
With TortoiseHG
The only think to do is download the TortoiseHg installer package and after install reboot your system. [download]