Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > 0b38be552745286620faf2138b9468d0 > files > 78

subversion-doc-1.4.6-5.1mdv2008.1.x86_64.rpm

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>High-speed Tutorial</title><link rel="stylesheet" href="styles.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><link rel="start" href="index.html" title="Version Control with Subversion" /><link rel="up" href="svn.intro.html" title="Appendix A. Subversion Quick-Start Guide" /><link rel="prev" href="svn.intro.install.html" title="Installing Subversion" /><link rel="next" href="svn.forcvs.html" title="Appendix B. Subversion for CVS Users" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">High-speed Tutorial</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="svn.intro.install.html">Prev</a> </td><th width="60%" align="center">Appendix A. Subversion Quick-Start Guide</th><td width="20%" align="right"> <a accesskey="n" href="svn.forcvs.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="svn.intro.quickstart"></a>High-speed Tutorial</h2></div></div></div><div class="blockquote"><blockquote class="blockquote"><p>“<span class="quote">Please make sure your seat backs are in their full,
        upright position, and that your tray tables are stored.
        Flight attendants, prepare for take-off….</span>”</p></blockquote></div><p>What follows is a quick tutorial that walks you through some
      basic Subversion configuration and operation.  When you finish
      it, you should have a basic understanding of Subversion's
      typical usage.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>The examples used in this appendix assume that you have
        <span class="command"><strong>svn</strong></span>, the Subversion command-line client,
        and <span class="command"><strong>svnadmin</strong></span>, the administrative tool,
        ready to go on a Unix-like operating system.  (This tutorial
        also works at the Windows commandline prompt, assuming you
        make some obvious tweaks.)  We also assume you are using
        Subversion 1.2 or later (run <span class="command"><strong>svn --version</strong></span>
        to check.)</p></div><p>Subversion stores all versioned data in a central
      repository.  To begin, create a new repository:</p><pre class="screen">
$ svnadmin create /var/svn/repos
$ ls /var/svn/repos
conf/  dav/  db/  format  hooks/  locks/  README.txt
</pre><p>This command creates a new directory
      <code class="filename">/var/svn/repos</code> which contains a Subversion
      repository.  This new directory contains (among other things) a
      collection of database files.  You won't see your versioned
      files if you peek inside.  For more information about repository
      creation and maintenance, see
      <a class="xref" href="svn.reposadmin.html" title="Chapter 5. Repository Administration">Chapter 5, <i>Repository Administration</i></a>.</p><p>Subversion has no concept of a “<span class="quote">project</span>”.  The
      repository is just a virtual versioned filesystem, a large tree
      that can hold anything you wish.  Some administrators prefer to
      store only one project in a repository, and others prefer to
      store multiple projects in a repository by placing them into
      separate directories.  The merits of each approach are discussed
      in <a class="xref" href="svn.reposadmin.planning.html#svn.reposadmin.projects.chooselayout" title="Planning Your Repository Organization">the section called “Planning Your Repository Organization”</a>.
      Either way, the repository only manages files and directories,
      so it's up to humans to interpret particular directories
      as “<span class="quote">projects</span>”.  So while you might see references
      to projects throughout this book, keep in mind that we're only
      ever talking about some directory (or collection of directories)
      in the repository.</p><p>In this example, we assume that you already have some sort
      of project (a collection of files and directories) that you wish
      to import into your newly created Subversion repository.  Begin
      by organizing your data into a single directory
      called <code class="filename">myproject</code> (or whatever you wish).
      For reasons that will be clear later (see
      <a class="xref" href="svn.branchmerge.html" title="Chapter 4. Branching and Merging">Chapter 4, <i>Branching and Merging</i></a>), your project's tree
      structure should contain three top-level directories
      named <code class="filename">branches</code>,
      <code class="filename">tags</code>, and
      <code class="filename">trunk</code>.  The <code class="filename">trunk</code>
      directory should contain all of your data,
      while <code class="filename">branches</code>
      and <code class="filename">tags</code> directories are empty:</p><pre class="screen">
/tmp/myproject/branches/
/tmp/myproject/tags/
/tmp/myproject/trunk/
                     foo.c
                     bar.c
                     Makefile
                     …
</pre><p>The <code class="filename">branches</code>, <code class="filename">tags</code>,
      and <code class="filename">trunk</code> subdirectories aren't actually
      required by Subversion.  They're merely a popular convention
      that you'll most likely want to use later on.</p><p>Once you have your tree of data ready to go, import it into
      the repository with the <span class="command"><strong>svn import</strong></span> command
      (see <a class="xref" href="svn.tour.importing.html" title="Getting Data into your Repository">the section called “Getting Data into your Repository”</a>):</p><pre class="screen">
$ svn import /tmp/myproject file:///var/svn/repos/myproject -m "initial import"
Adding         /tmp/myproject/branches
Adding         /tmp/myproject/tags
Adding         /tmp/myproject/trunk
Adding         /tmp/myproject/trunk/foo.c
Adding         /tmp/myproject/trunk/bar.c
Adding         /tmp/myproject/trunk/Makefile
…
Committed revision 1.
$ 
</pre><p>Now the repository contains this tree of data.  As mentioned
      earlier, you won't see your files by directly peeking into the
      repository;  they're all stored within a database.  But the
      repository's imaginary filesystem now contains a top-level
      directory named <code class="filename">myproject</code>, which in turn
      contains your data.</p><p>Note that the original <code class="filename">/tmp/myproject</code>
      directory is unchanged; Subversion is unaware of it.  (In fact,
      you can even delete that directory if you wish.)  In order to
      start manipulating repository data, you need to create a new
      “<span class="quote">working copy</span>” of the data, a sort of private
      workspace.  Ask Subversion to “<span class="quote">check out</span>” a working
      copy of the <code class="filename">myproject/trunk</code> directory in
      the repository:</p><pre class="screen">
$ svn checkout file:///var/svn/repos/myproject/trunk myproject
A  myproject/foo.c
A  myproject/bar.c
A  myproject/Makefile
…
Checked out revision 1.
</pre><p>Now you have a personal copy of part of the repository in a
      new directory named <code class="filename">myproject</code>.  You can edit
      the files in your working copy and then commit those changes
      back into the repository.</p><div class="itemizedlist"><ul type="disc"><li><p>Enter your working copy and edit a file's
          contents.</p></li><li><p>Run <span class="command"><strong>svn diff</strong></span> to see unified diff
          output of your changes.</p></li><li><p>Run <span class="command"><strong>svn commit</strong></span> to commit the new
          version of your file to the repository.</p></li><li><p>Run <span class="command"><strong>svn update</strong></span> to bring your working
          copy “<span class="quote">up-to-date</span>” with the repository.</p></li></ul></div><p>For a full tour of all the things you can do with your
      working copy, read <a class="xref" href="svn.tour.html" title="Chapter 2. Basic Usage">Chapter 2, <i>Basic Usage</i></a>.</p><p>At this point, you have the option of making your repository
      available to others over a network.  See <a class="xref" href="svn.serverconfig.html" title="Chapter 6. Server Configuration">Chapter 6, <i>Server Configuration</i></a> to learn about the different sorts of
      server processes available and how to configure them.</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="svn.intro.install.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="svn.intro.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="svn.forcvs.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Installing Subversion </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Appendix B. Subversion for CVS Users</td></tr></table></div></body></html>