04.08.2013 Views

Version Control with Subversion - Electrical and Computer ...

Version Control with Subversion - Electrical and Computer ...

Version Control with Subversion - Electrical and Computer ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

the repository. While these aren't strict requirements like the syntax described above, they help to organize<br />

frequently performed tasks. The /trunk part of URLs you'll find throughout this book is one of these conventions;<br />

we'll talk a lot more about it <strong>and</strong> related recommendations in Chapter 4, Branching <strong>and</strong> Merging.<br />

Although the above example checks out the trunk directory, you can just as easily check out any deep<br />

subdirectory of a repository by specifying the subdirectory in the checkout URL:<br />

$ svn checkout http://svn.collab.net/repos/svn/trunk/doc/book/tools<br />

A tools/readme-dblite.html<br />

A tools/fo-stylesheet.xsl<br />

A tools/svnbook.el<br />

A tools/dtd<br />

A tools/dtd/dblite.dtd<br />

…<br />

Checked out revision 2499.<br />

Since <strong>Subversion</strong> uses a “copy-modify-merge” model instead of “lock-modify-unlock” (see Chapter 2,<br />

Basic Concepts), you're already able to start making changes to the files <strong>and</strong> directories in your working<br />

copy. Your working copy is just like any other collection of files <strong>and</strong> directories on your system. You<br />

can edit <strong>and</strong> change them, move them around, you can even delete the entire working copy <strong>and</strong> forget<br />

about it.<br />

Note<br />

While your working copy is “just like any other collection of files <strong>and</strong> directories on your<br />

system”, you need to let <strong>Subversion</strong> know if you're going to be rearranging anything inside<br />

of your working copy. If you want to copy or move an item in a working copy, you should<br />

use svn copy or svn move instead of the copy <strong>and</strong> move comm<strong>and</strong>s provided by your operating<br />

system. We'll talk more about them later in this chapter.<br />

Unless you're ready to commit a new file or directory, or changes to existing ones, there's no need to further<br />

notify the <strong>Subversion</strong> server that you've done anything.<br />

What's <strong>with</strong> the .svn directory?<br />

Guided Tour<br />

Every directory in a working copy contains an administrative area, a subdirectory named .svn. Usually, directory<br />

listing comm<strong>and</strong>s won't show this subdirectory, but it is nevertheless an important directory. Whatever<br />

you do, don't delete or change anything in the administrative area! <strong>Subversion</strong> depends on it to manage your<br />

working copy.<br />

While you can certainly check out a working copy <strong>with</strong> the URL of the repository as the only argument,<br />

you can also specify a directory after your repository URL. This places your working copy in the new<br />

directory that you name. For example:<br />

$ svn checkout http://svn.collab.net/repos/svn/trunk subv<br />

A subv/subversion.dsw<br />

A subv/svn_check.dsp<br />

A subv/COMMITTERS<br />

A subv/configure.in<br />

A subv/IDEAS<br />

…<br />

Checked out revision 2499.<br />

24

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!