Simple SVN Primer

From HotDec

Jump to: navigation, search

Contents

Overview

When working on a project, a Subversion (SVN) repository will aid in tracking changes and coordinating among several contributors. Subversion allows a user to bring their copy of the project up to date with the main copy, view the history of changes, and add their contributions back into the main copy.

Clients


General Instructions

Suppose that there is a project that you would like to view and possibly make contributions to. You learn that the project's SVN repository is located at 'svn://some.machine/book'. Here are the steps you should follow:

  1. Create a directory for your project. This is called the 'working copy'.
  2. Copy the present state of the project to your working copy. This is 'svn checkout'.
  3. Whenever you have made useful changes, put those changes in the main copy. This is 'svn commit'.
  4. Bring other contributor's changes into your working copy daily. This is 'svn update'.


Detailed instructions for TortoiseSVN / Windows

  1. Create a working-directory for your project
  2. Check-out the project to this directory.
    • right click your folder
    • select 'SVN Checkout'
    • URL = "svn://some.machine/book"
    • OK
  3. Update/Commit whenever the project is in a release-worthy state.
    • right click the working-copy folder
    • select "SVN Update"
    • You may need to resolve conflicts if the Trunk has changed.
    • select "SVN Commit"
      **enter a descriptive log message**
    • OK
  4. Repeat Step 3.


Detailed instructions for SVN commandline (Linux / Mac)

  1. Create a working-directory for your project. We'll use '~/book'.
    • mkdir ~/book
  2. Check-out the project to this directory.
    • svn co svn://some.machine/book ~/book
      (note that capitalization is important on Linux)
      ('co' is short for 'checkout')
  3. Update/Commit whenever the project is in a release-worthy state.
    • svn up ~/book/
      ('up' is short for 'update')
    • You may need to resolve conflicts if the Trunk has changed
    • svn ci ~/book/ -m "<log-message>"
      ('ci' is short for 'commit')
  4. Repeat Step 3.

'

Personal tools