Subversion

From WikiHack

Jump to: navigation, search

Subversion is a Version Controls System. Version control is the management of multiple revisions of the same unit of information. It is most commonly used in engineering and software development to manage ongoing development of digital documents like application source code, art resources such as blueprints or electronic models, and other projects that may be worked on by a team of people. Changes to these documents are usually identified by incrementing an associated number or letter code, termed the "revision number", "revision level", or simply "revision" and associated historically with the person making the change. A simple form of revision control, for example, has the initial issue of a drawing assigned the revision number "1". When the first change is made, the revision number is incremented to "2" and so on.

The most popular client to use with subversion is tortoiseSVN.

Contents

Guide to Using Subversion with TortoiseSVN

Setting Up TortoiseSVN

  • First of all download and install the latest version of TortoiseSVN

Checkout Repository

  • Once TortoiseSVN has been installed create a folder to checkout the project files into:
    • Ex: c:\projects\h2h\challenge1
  • Once the folder is created, right-click on it and select checkout:

Image:Subversion_checkout.png

  • Then fill in IP Address or the computer name followed by the project:
    • Ex: svn://123.456.789.159/teamA (This will be the URL of the repository)

Image:checking_out.png

  • Click okay and the project files will be downloaded into the selected folder.
  • Once the code has been checked out a green check mark will show up on the folder as well as all files and subfolders within it.

Tortoise SVN Symbols

Image:Symbols.png

  • Your files and folders will initially have green check marks to indicate that they have not been changed since you checked out or last updated.
  • i.e. your files look exactly like the revision you have checked out.
  • Every time the code is updated a new revision is created (More on updating below):

Image:revisions.png

  • If you make any changes to a file it along with all parent folders will have a red exclamation mark on it, showing that it has been changed.


Updating Your Code

  • At any time in the future you can update any file or folder under source control (Has a Green Check Mark or a Red Exclamation Mark)
  • Just right click on the file or folder and click 'SVN Update':

Image:Update.png

  • All files and sub-folders if there are any will be updated with the newest code

Committing Code

  • You can commit any files or folders that have red exclamation marks by them
  • Just right click on the file or folder then select 'SVN Commit'
  • If there is more than one file you have changed then you can select to only commit certain changes:

Image:Commiting.png

  • When you commit code the repository is updated with your new code and a new revision is created.
  • BE SURE TO ADD COMMENTS WHEN YOU COMMIT CODE! (This is courteous to your teammates and tells them what you did!)
  • Also if you have made changes and decide that you made a mistake and want to start clean, you can right-click and click revert file to revert it to the revision you have checked out.
Personal tools