This document assumes that you are working in GNU/Linux. The procedures in Win/Cygwin are essentially the same. In Windows, the TortoiseSVN provides the same functionality through the right-mouse-button-menu in the file explorer.
Documentation for every command is available via
help, which lists all available commands.
command provides help for a specific command.
Subversion (SVN) stores the entire revision history in a
repository on the server
Each author has a local copy of the files, and uses the
svn client communicates with the server, which
synchronizes the changes made by the different authors, via the
Before you start working, place the file
config in the directory
~/.subversion/. If the directory does not already
exist, run the
svn once, to create it. This config
file sets default values for file properties and date handling.
Every SVN command that interacts with the server needs to log in; if you want to avoid having to type your password multiple times, ask finn about configuring your SSH client to use SSH-keys instead.Decide where to put your working copy of the project, here
mcrepository. Here, I'll assume
svn checkout svn+ssh://svn.maths.lth.se/home/finn/mc/trunk/fms051/ fms051/
~/svn/mc/fms051/, which will be your local work copy of the project.
To incorporate your co-authors changes into your local copy, run
which retrieves the latest versions from the repository, as well as any new directories.
Pay attention to the messages printed by the svn command; There may be conflicts between your local changes, and the versions in the repository, which have to be resolved before you enter your own changes into the repository. These are marked with the letter "C" in the listing of files affected by the update.
When you want to add your own changes to the repository, run
svn commit -m 'Brief modification description'
Always do an
commit, to incorporate the modifications of
svn will not accept a
a file with conflicting changes, until you have explicity told it
that the conflict has been fixed, by running
The basic work cycle is as follows:
svn commit -m 'This is what I did.'
When you add or remove a file, SVN must be told about it.
svn add filename.ext to add a file
filename.ext to the SVN system.
SVN makes an effort to identify binary files, which must be treated
differently from text files. Usually its guess is correct.
The file must exist before adding it.
For directories, the command
svn mkdir dirname creates a
new directory, and tells SVN about it.
svn delete filename.ext to remove the file
filename.ext. This will delete the files both from
your local working copy and from SVN. The file and all its
previous versions are kept in the repostitory, so it can be
resurrected at a later time. This commands also works for
The addition/deletion will not be visible to outher authors until you have committed the change.
Files and directories can also be copied, moved, and renamed (equivalent to a move).
svn copy filename.ext nameofcopy.ext
svn move filename.ext newname.ext
This copies/moves the file, in the same manner as the shell commands
Some Mat.Stat. courses are handled with SVN. To simplify and semi-automating the tasks of synchronising the repository with the central web and matlab directories, one (or more) Makefile:s are available.
Every commit to the SVN repository is identified with an autoincremented number. (This is different from CVS which assigned different version numbers to each file).
To see the commit messages for the entire history of a file, use
svn log filename.ext
svn diff filename.ext displays the difference between
the latest seen repository version, and your local work copy. You can
access the differences to a specific revision with the
svn diff -r1374 filename.ext
To see a list of the status of your working copy:
This shows modified files ("M") and files not under SVN control ("?") that you have not told it to ignore via the
The config file above sets global ignores for your svn client, but
since this is based on the client, other authors are helped by naming
patterns such as
*.aux *.dvi explicity in the
svn:ignore property for directories with LaTeX files.
CVS stores the entire revision history in a repository.
[TODO: How to create a repository.]
[TODO: How to create a new project from existing files.]