Tortoise SVN Tutorial

This document explains how to setup and use tortoise-svn, which is subversion client software for windows.

About Subversion

Subversion is a version control system that allows multiple people to work on a project at the same time. Subversion works by maintaining a central repository, hosted on a server, that contains the canonical version of files and allowing people to make local copies of that repository on their personal computer in a process called a checkout. Each person has full control over their local copy and can propagate changes they make to their local copy back to the repository in a process called a commit. Other people can then see those changes when they update their local copy.

Installing

Start by downloading the tortoise-svn installer from this page. The 32-bit version is highly recommended, unless you're running 64-bit windows. Run the installer. After the installation is complete, you should be propted to restart your computer.

Configuring

To avoid having to type the password six times on each commit, you'll want to do the following:

Open the TortoiseSVN settings windows. Click on the Network tab and replace the SSH Client with the following:

C:\Program Files\TortoiseSVN\bin\TortoisePlink.exe

Checkout

In Windows Explorer, go to the folder you want to checkout the repository into. Right click, and select SVN Checkout. Copy the URL of the repository you want into the URL field:

Website Source
svn+ssh://sciencefair@math.iit.edu/home/sciencefair/svn/website
Documentation and Standards
svn+ssh://sciencefair@math.iit.edu/home/sciencefair/svn/docs
Build, Validation, Maintainance Tools
svn+ssh://sciencefair@math.iit.edu/home/sciencefair/svn/tools

Modifying files

The goal is to include only content. Don't worry about centering or underlining a title, the css (style sheet) will take care of that. We also want all files to be of the form /index, NOT /index.html.

  1. We've had some encoding problems using Wordpad, so I suggest downloading the 30 day trial of EditiX 2008, which can be found here for all operating systems.
  2. If you have an HTML file extension tag, the first thing you should do is rename it to take away the HTML file tag. (So index.html becomes index) Refer to the renaming section below for how to properly rename.
  3. The files without extensions are the ones that you should be modifying. Open up the EditiX editor and then open the file you want to edit. When opening the file, make sure you select "All Files" on the bottom.
  4. The editor will suggest corrections and mark errors as you go. Also, all special characters such as apostrophes, quotations, and hyphens will be rendered in all browsers, because this editoris UTF-8 encoded.
  5. Make sure to follow the standards that are set out. To view your changes before committing, simply click on the file from the "My Documents" directory again (after you saved it) and open with an internet browser. If a security bar shows up, just choose "Allow Blocked Content" and the webpage with your changes will show up.

After you type in the password, a new directory should appear containing the checked out files. You now have a local copy of the repository.

File Management

Tortoise SVN makes file management tasks really simple. Remember, these commands only make changes to your working copy initially. To propagate those changes to the repository, you need to do a commit.

Tortoise SVN Options

It is important that you do everything through the Tortoise SVN menus.

Moving

Simply right click on the file that you want to move, go to the Tortoise SVN option, and click on relocate. Then simply type in the new path for the file or folder.

Adding

If you've created a new file in the repository, Tortoise SVN will ignore it by default. To tell Tortoise that you want this file to be added to the repository, simply right click on the file, select the Tortoise SVN submenu, and click add.

Deleting

If you see an obsolete file with no references (links from other documents), you can (and should) delete it. Remember, the repository history is saved so users can always dig up the file again if it's needed for some reason. With subversion, there's no excuse for leaving junk lying around. To delete a file, just right click on it, go to the Tortoise SVN option, and click on delete.

Committing

Committing a file is uploading your changes to the repository (working copy). It is not making live changes to the website (or the test website for that matter). However, all your changes will be able to be seen by everyone else who can then update these changes to their systems. To commit a file, simply right click on the file or folder you would like to commit, and click SVN Commit. If you would like to commit the whole folder you are working in, you can right click in the blank space and do the same. You will know if your changes are not committed because the file will have a red exclamation mark next to it instead of a green checkmark. That means that the file was edited but not uploaded to the repository (it is only changed on your system). The infrastructure team will worry about making the changes live to the website.

When you commit a file, you must first write your name and then write a short message explaining the changes you made. (i.e. Tony: /riemannintegral/index converted into valid XHTML.)

Renaming

Simply right click on the file that you want to rename, select the Tortoise SVN submenu, and click on rename. A box will appear, and simply type the new name in the box. This is especially useful for taking off html tags. All you have to do is write the file name and delete the tag. So index.html would be renamed simply to index.

Images

If you take any screenshots or make any images, the preferable file is .png.

Updating

You should get in the habit of updating your local copy right before you start work in the repository and right before you commit. Updating allows you to see the changes other people have made to the repository as well as resolve any editing conflicts that may arise before you make your own changes.

To perform an update, right click on the folder or window you want updated and select SVN Update. After you type in the password, your local copy will be updated with changes other people have made to the repository.

Committing

Committing a file is uploading your changes to the repository (working copy). It is not making live changes to the website (or the test website for that matter). However, all your changes will be able to be seen by everyone else who can then update these changes to their systems. To commit a file, simply right click on the file or folder you would like to commit, and click SVN Commit. If you would like to commit the whole folder you are working in, you can right click in the blank space and do the same. You will know if your changes are not committed because the file will have a red exclamation mark next to it instead of a green checkmark. That means that the file was edited but not uploaded to the repository (it is only changed on your system). The infrastructure team will worry about making the changes live to the test website.

When you commit a file, you must write a short message explaining the changes you made.

References