The Work Cycle
Using Subversion effectively requires you to learn some new habits (and possibly unlearn some old ones).
Checking for Updates
When you sit down to work, the first thing that you do should be to check for any updates. Your system may be set up to e-mail changes to you; in that case you can find out if there are any updates (as well as what they were) by checking your e-mail.
If your repository doesn't e-mail you changes, you can always
svn update to have the most recent changes to
the trunk or branch you're working on downloaded to your
Once your repository is updated, you can start working. Ideally, you should make changes that are all related to a single issue, such as fixing a particular bug, or updating a single chapter (or maybe a single idea in multiple chapters). Once you've resolved that one problem or issue, you should check in your changes.
Checking in Your Changes
You can see what files you've changed by typing the
svn diff will run the
diff program and show you a
-u-formatted listing of the changes that you've made compared
to the last version of the repository that you updated to.
svn status and
svn diff do not
access the repository, so you can even use them when you can't reach
your repository (such as when you're somewhere without a network
When you're ready to check your changes into the repository, you
can run the
svn ci command. For brief changes, you can
supply a message about what you've done on the command line using
-m flag, as in
svn ci -m "Updated all references to Bigcomp with BigComp."
For more complicated changes, you should construct a more
meaningful message. Subversion can be configured to call an editor
that you can use to compose a more detailed message (by setting the
SVN_EDITOR environment variable). GUI
clients will generally give you a dialog box to type or paste into.
svn ci will also read in a file (with the
--file option), so you can compose a
message in advance and still use the command-line client.
Garrett Rooney has good advice on developing good work habits. There are links to more information on our version-control resources page.