Initial Setup

cd to your working directory, and issue the command:

svn checkout 
svn+ssh://[email protected]/usr/local/svn-glotzer-repos/Glotzilla

You will be prompted for your password several times, this is normal.

Updating your local version

Before you begin editing the code, make sure you have the most current version on your machine. To update your local working copy, issue the command:

svn update

This command gives you various pieces of information about files (these flags are common between most commands):

  • U : file was updated
  • A : file or directory was added to your working copy
  • D : file or directory was deleted from your working copy
  • R : file or directory was replaced in your working directory
  • G : file received new changes but local modifications were identical or did no conflict (the files were succesfully merged by subversion
  • C : file received conflicting changes to the file in your working directory (the files need to be merged by YOU)Committing changes to the repository

To commit modifications to the server, issue the command:

svn commit -m "descriptive string regarding what was changed"

Common problems with committing/updating

A common error you may get after trying to run svn commit is as follows:

Transmitting file data .svn: Commit failed (details follow):
svn: Out of date: 

This means that that one or more of the files that has been changed on your local machine was updated more recently on the repository (i.e. someone else changed the original file you modified and committed it to the repository before you committed it). If this is the case, issue the svn update command will download the updated files. For example, if you were trying to update "main.c", the result on your machine would be:

  • main.c (contains the source of both your copy of main.c and the copy on the repository)
  • main.c.mine (which corresponds to your version of main.c)
  • main.c.r5 & main.c.r6 (where r5 and r6 correspond to the previous and current version of main.c on the repository)

The command svn status will highlight these files for you.

To see what is different between these files, you can issue the command svn diff.

main.c will contain conflict markers, for instance:

//this is a test file
//this contains information
<<<<<<< .mine
//my changes I made in my working directory
//these are my changes
=======
//changes on the server
//other users changes
>>>>>>> .r6

Where clearly .mine refers to the changes on your local working directory. These sort of conflicts must be resolved by the users. You will need to communicate with the user that also changed the file and come to an agreement regarding what is appropriate.

Once this has been resolved, remove the conflict markers, and issue the command:

svn resolved FILENAME

At this point you can issue the svn commit command to update the repository.

If you wish to remove your changes in favor of the current version on the repository, issue the command:

svn revert FILENAME

More details on conflicts can be viewed at : http://svnbook.red-bean.com/en/1.2/svn.tour.cycle.html

Adding/Removing Files

Subversion keeps track of what files are part of the repository. As such, if you create a new file or folder, you must tell subversion about it to have it properly included. The basic command is:

svn add FILENAME

Similarly, you can remove files using the delete command:

svn delete FILENAME

Other commands:

svn copy OLDFILE NEWFILE
svn move OLDFILE NEWFILE

If you delete, add, move, or copy a file, you must issue the svn commit -m command to have these changes take effect on the repository.

Documentation

http://svnbook.red-bean.com/