hgbook
diff en/tour.tex @ 87:0995016342f8
More bumf.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Wed Oct 04 17:11:53 2006 -0700 (2006-10-04) |
parents | b7c69a68b0cc |
children | d351032c189c |
line diff
1.1 --- a/en/tour.tex Wed Oct 04 15:15:54 2006 -0700 1.2 +++ b/en/tour.tex Wed Oct 04 17:11:53 2006 -0700 1.3 @@ -75,6 +75,62 @@ 1.4 work. XXX Flesh this out. 1.5 \end{note} 1.6 1.7 +\section{Getting started} 1.8 + 1.9 +To begin, we'll use the \hgcmd{version} command to find out whether 1.10 +Mercurial is actually installed properly. The actual version 1.11 +information that it prints isn't so important; it's whether it prints 1.12 +anything at all that we care about. 1.13 +\interaction{tour.version} 1.14 + 1.15 +\subsection{Built-in help} 1.16 + 1.17 +Mercurial provides a built-in help system. This invaluable for those 1.18 +times when you find yourself stuck trying to remember how to run a 1.19 +command. If you are completely stuck, simply run \hgcmd{help}; it 1.20 +will print a brief list of commands, along with a description of what 1.21 +each does. If you ask for help on a specific command (as below), it 1.22 +prints more detailed information. 1.23 +\interaction{tour.help} 1.24 +For a more impressive level of detail (which you won't usually need) 1.25 +run \hgcmdargs{help}{\hggopt{-v}}. The \hggopt{-v} option is short 1.26 +for \hggopt{--verbose}, and tells Mercurial to print more information 1.27 +than it usually would. 1.28 + 1.29 +\section{Working with a repository} 1.30 + 1.31 +In Mercurial, everything happens inside a \emph{repository}. The 1.32 +repository for a project contains all of the files that ``belong to'' 1.33 +that project, along with a historical record of the project's files. 1.34 + 1.35 +There's nothing particularly magical about a repository; it is simply 1.36 +a directory tree in your filesystem that Mercurial treats as special. 1.37 +You can rename delete a repository any time you like, using either the 1.38 +command line or your file browser. 1.39 + 1.40 +\subsection{Making a copy of a repository} 1.41 + 1.42 +\emph{Copying} a repository is just a little bit special. While you 1.43 +could use a normal file copying command to make a copy of a 1.44 +repository, it's best to use a built-in command that Mercurial 1.45 +provides. This command is called \hgcmd{clone}, because it creates an 1.46 +identical copy of an existing repository. 1.47 +\interaction{tour.clone} 1.48 +If our clone succeeded, we should now have a local directory called 1.49 +\dirname{hello}. This directory will contain some files. 1.50 +\interaction{tour.ls} 1.51 +These files have the same contents and history in our repository as 1.52 +they do in the repository we cloned. 1.53 + 1.54 +Every Mercurial repository is complete, self-contained, and 1.55 +independent. It contains its own private copy of a project's files 1.56 +and history. A cloned repository remembers the location of the 1.57 +repository it was cloned from, but it does not communicate with that 1.58 +repository, or any other, unless you tell it to. 1.59 + 1.60 +What this means for now is that we're free to experiment with our 1.61 +repository, safe in the knowledge that it's a private ``sandbox'' that 1.62 +won't affect anyone else. 1.63 1.64 %%% Local Variables: 1.65 %%% mode: latex