Subversion has numerous features, options, bells and whistles, but on
a day-to-day basis, odds are that you will only use a few of them. In
this section we'll run through the most common things that you might
find yourself doing with Subversion in the course of a day's work.
The typical work cycle looks like this:
When working on a project with a team, you'll want to
update your working copy to receive any changes made since
your last update by other developers on the project. Use
svn update
to bring your working copy into
sync with the latest revision in the repository.
$ svn update
U foo.c
U bar.c
Updated to revision 2.
In this case, someone else checked in modifications to
both foo.c
and bar.c
since the last time you updated, and Subversion has updated
your working copy to include those changes.
Let's examine the output of
svn update
a bit more. When the server sends changes to your working
copy, a letter code is displayed next to each item to let you
know what actions Subversion performed to bring your working
copy up-to-date:
-
U foo
-
File foo
was
U
pdated (received changes
from the server).
-
A foo
-
File or directory foo
was
A
dded to your working
copy.
-
D foo
-
File or directory foo
was
D
eleted from your working
copy.
-
R foo
-
File or directory foo
was
R
eplaced in your working
copy; that is, foo
was deleted, and a
new item with the same name was added. While they may have
the same name, the repository considers them to be distinct
objects with distinct histories.
-
G foo
-
File foo
received new changes
from the repository, but your local copy of the file had
your modifications. Either the changes did not intersect,
or the changes were exactly the same as your local
modifications, so Subversion has successfully
merG
ed the repository's
changes into the file without a problem.
-
C foo
-
File foo
received
C
onflicting changes from
the server. The changes from the server directly overlap
your own changes to the file. No need to panic, though.
This overlap needs to be resolved by a human (you); we
discuss this situation later in this chapter.
[an error occurred while processing this directive]