Svn

From CSE473 Wiki
Revision as of 23:30, 15 July 2014 by Guerin (talk | contribs) (Created page with "An svn repository has been setup for each student on shell.cec.wustl.edu. These will be used in connection with labs and studios. SVN is an open-source [http://svnbook.red-bea...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

An svn repository has been setup for each student on shell.cec.wustl.edu. These will be used in connection with labs and studios. SVN is an open-source control system that allows multiple users working on a common set of files to synchronize through a server (the repository). Repositories can be accessed using any of a number of svn clients. SVN clients come native on most Unix distributions including MAC OSX and Linux. There are also a number of GUI-based SVN clients for Windows, the MAC and Linux. On Windows, [1] is a nice client that is also available in the Urbauer labs.

The first time you use your SVN client to access the repository for the labs, you will first need to "checkout" a local copy on your machine.

To checkout a working copy of your repository on a unix/linux system, type the following within a shell window. (These instructions assume that svn is installed on your computer - if not, you can download it from the subversion web site - http://subversion.apache.org/).

svn checkout https://shell.cec.wustl.edu:8443/cse473_fl13/svn/yourConnectKey/

You should substitute your own WUSTL Connect Key login name in place of "yourConnectKey".

You will be prompted for a password. Use your Connect Key password. Once you have checked out a copy of your repository, you will see a new directory (folder) with the same name as your repository. Do a cd to this directory and take note of the various files and sub-directories that now appear there.

If you are using TortoiseSvn on a Windows PC, open Windows explorer and create a new folder in an appropriate location. Right-click within the empty folder to bring up a "context menu", which should include an SVN checkout menu item. Selecting this will bring up a dialog box in which you can enter the URL for your repository. This takes the form

https://shell.cec.wustl.edu:8443/cse473_fl13/svn/yourConnectKey/

Proceed as described above.

There are two basic functions to svn: update and commit, which synchronize your local copy with the repository.\\ The update command (svn update from command line) downloads into your local copy any file for which the repository has a newer version. You can also ask the repository for an updated copy of an individual file simply by appending its name after the command (or selecting if from the GUI menu).\\ The commit command (svn commit from command line) uploads back to the repository files that you have been modifying. This allows others to download them (with the update command). Again, you can ask to commit a single file by appending its name after the command (or selecting if from the GUI menu).

The other command you may need to use is the add command, svn add, which as its name indicates will identify that a new file needs to be added to the repository. It can be applied to either a directory or a specific file. Many GUIs actually give the option to add an entire new directory and its content in one operation, or for existing directories to check for "unversioned" files, i.e., files that have not yet been added, and select them all.\\ NOTE: After you have added a file to the repository, you still need to issue a commit command to have it actually uploaded to the repository, i.e., it is a two-step process (again, some client allow you to combine the add and commit operation).