<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass[onecolumn,letterpaper,11pt]{article}

%===================================================================
\input{common_latex/common_latex_packages}
\input{common_latex/common_latex_definitions}
\input{common_latex/common_latex_help_format}
%===================================================================

\begin{document}

\begin{labcover}
\labtitle{Help Topic: The SVN Checkout Command}
\vspace{0.1in}
\labdate{Spring 2021}
\vspace{0.1in}
\labauth{Michael Benjamin, mikerb@mit.edu}
\labauth{Department of Mechanical Engineering}
\labauth{MIT, Cambridge MA 02139}
\labline
\end{labcover}

\wikidoc{file=Help.SVNCheckout}
\wikidoc{auth=mikerb@mit.edu}

%====================================================================
\section*{Checking out a Repository with the \cmd{checkout} Command}
%====================================================================


The svn \cmd{checkout} command is likely the first comannd you'll need
to know since this is how you get a local copy of an svn repository
from a server to your machine. The basic command is simple, but there
are a few other useful ways of using it that we discuss here.  More
info can always be found by Googling "Subversion book" and reading the
full PDF online free, or just typing \cmd{svn help checkout} anytime
on the command line.

%---------------------------------------------------------------------
\subsection*{Basic use of the svn \cmd{checkout} command}

The basic syntax for the \cmd{checkout} command is:

\vspace{0.05in}
\begin{consoleverb}
 $ svn co &lt;url&gt;
\end{consoleverb}
\vspace{0.15in}

\noindent
For example the course software is checked out with:

\vspace{0.05in}
\begin{consoleverb}
 $ svn co https://oceanai.mit.edu/svn/moos-ivp-aro/trunk moos-ivp
\end{consoleverb}
\vspace{0.15in}

\noindent
Note that you can provide a name for the locally checked out directory
that may be different than the repository name. In the example above,
if you ommitted the "moos-ivp" as the last command-line argument, the
checkout would have produced a file named "trunk" on your local
machine.

%---------------------------------------------------------------------
\subsection*{Check out an older revision with the \cmd{checkout} command }

One of the core strengths of a version control system is the ability to undo
changes, or at least go back to an older version if need be. This can be
done with the \cmd{svn checkout} command by providing information on the 
command line about the version you want to go back to. If I'm doing this, 
typically I make a copy of the newer/broken checkout, and then make a newer
checkout with the revision I'm looking for. For example, you can check
out a copy of the course software as it looked on February 17th, 2011, 
in the following way.

\vspace{0.15in}
\begin{consoleverb}
 $ ls 
 moos-ivp/
 $ mv moos-ivp moos-ivp-today
 $ ls
 moos-ivp-today/
 $ svn co -r "{2011-02-17}" https://oceanai.mit.edu/svn/moos-ivp-aro/trunk moos-ivp
 $ ls
 moos-ivp/   moos-ivp-today/
\end{consoleverb}
\vspace{0.15in}

\noindent
Sometimes specifying the desired revision ty the date is not sufficient. There
may be multiple revisions checked in on that date. You may be working on a
project where you and your partners checked in 50 changes yesterday alone. And
you may need to go back to a particular revision. In this case you can get
the revision number by using the \cmd{svn log} command. This is described in 
a separate topic. Also, the log may only help you if you add comments on each
check-in. That's also a separate topic. But for the purposes here, if you know
the revision number, say revision 523, you can checkout a copy of the tree 
using this instead of the date:

\vspace{0.15in}
\begin{consoleverb}
 $ svn co -r 523 https://oceanai.mit.edu/svn/moos-ivp-aro/trunk moos-ivp
\end{consoleverb}

%---------------------------------------------------------------------
\subsection*{Checking out just a subset of a repository}

A nice feature of SVN is that is allows you to checkout just a subset
of a repository. If for example the repository tree structure is:

\vspace{0.15in}
\begin{consoleverb}
 food/
   fruit/
     apples/
     grapes/
   vegetables/
     peppers/
     sprouts/
\end{consoleverb}
\vspace{0.15in}

\noindent
You can check out the entire tree with:

\vspace{0.15in}
\begin{consoleverb}
 $ svn co http://acme-software.org/svn/food
\end{consoleverb}
\vspace{0.15in}

\noindent
Or you can check out just a portion of the tree with:

\vspace{0.15in}
\begin{consoleverb}
 $ svn co https://acme-software.org/svn/fruit/grapes
\end{consoleverb}
\vspace{0.15in}

\noindent
Finally, in case you're curious, you may have noticed in the command we
prescribe for checking out the moos-ivp tree:

\vspace{0.15in}
\begin{consoleverb}
 $ svn co https://oceanai.mit.edu/svn/moos-ivp-aro/trunk moos-ivp
\end{consoleverb}
\vspace{0.15in}

\noindent
This checkout requests only a portion (the trunk) of the full moos-ivp
tree, which has a high-level structure that looks something like this:

\vspace{0.15in}
\begin{consoleverb}
 moos-ivp/
   trunk/
   releases/
     moos-ivp-12.2/
     moos-ivp-13.2/
     moos-ivp-13.5/
   branches/
     branch-beta/
     branch-kilroy/
\end{consoleverb}
\vspace{0.15in}


\end{document}

</pre></body></html>