1 | <?xml version="1.0" encoding="utf-8"?> |
---|
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"> |
---|
3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
4 | <head> |
---|
5 | <title>svn basic commands</title> |
---|
6 | <link rel="stylesheet" href="style.css" type="text/css"/> |
---|
7 | <link rel="stylesheet" href="varamma.css" type="text/css"/> |
---|
8 | <meta name="generator" content="DocBook XSL Stylesheets V1.73.2"/> |
---|
9 | <meta xmlns="" http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
---|
10 | <meta xmlns="" name="robots" content="noindex,nofollow,noarchive"/> |
---|
11 | </head> |
---|
12 | <body> |
---|
13 | <div class="article" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id2681086"/><span class="command"><strong>svn</strong></span> basic commands</h2></div><div><div class="authorgroup"> |
---|
14 | <div class="author"><h3 class="author"><span class="firstname">Sébastien</span> <span class="surname">Masson</span></h3><code class="email"><<a class="email" href="mailto:Sebastien.Masson_at_locean-ipsl.upmc.fr">Sebastien.Masson_at_locean-ipsl.upmc.fr</a>></code></div> |
---|
15 | </div></div><div><p class="pubdate">$Id: svnbasiccommands.xml 3 2008-12-19 09:42:31Z pinsard $</p></div></div><hr/></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#help">1. <span class="command"><strong>svn</strong></span> help</a></span></dt><dt><span class="sect1"><a href="#download">2. Download varamma</a></span></dt><dt><span class="sect1"><a href="#update">3. Update varamma</a></span></dt><dt><span class="sect1"><a href="#compare">4. Compare your version with the reference deposit</a></span></dt><dt><span class="sect1"><a href="#addfile">5. Add a new file</a></span></dt><dt><span class="sect1"><a href="#createdir">6. Create a directory file</a></span></dt><dt><span class="sect1"><a href="#deletefile">7. Delete an existing file</a></span></dt><dt><span class="sect1"><a href="#addversion">8. Add automatic version number in a file</a></span></dt><dt><span class="sect1"><a href="#commit">9. Commit your changes</a></span></dt><dt><span class="sect1"><a href="#version">10. More info on your version</a></span></dt></dl></div> |
---|
16 | |
---|
17 | |
---|
18 | |
---|
19 | <div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="help"/>1. <span class="command"><strong>svn</strong></span> help</h2></div></div></div> |
---|
20 | |
---|
21 | <p> |
---|
22 | </p><pre class="screen"> |
---|
23 | <code class="prompt">$</code> <strong class="userinput"><code>svn help</code></strong> |
---|
24 | </pre><p> |
---|
25 | </p> |
---|
26 | |
---|
27 | <p> |
---|
28 | Help on a specific command (for example <span class="command"><strong>add</strong></span>): |
---|
29 | |
---|
30 | </p><pre class="screen"> |
---|
31 | <code class="prompt">$</code> <strong class="userinput"><code>svn help add </code></strong> |
---|
32 | </pre><p> |
---|
33 | </p> |
---|
34 | |
---|
35 | </div> |
---|
36 | <div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="download"/>2. Download varamma</h2></div></div></div> |
---|
37 | |
---|
38 | |
---|
39 | <p> |
---|
40 | To download varamma in the directory <code class="filename">~/varamma</code> execute (with the appropriate login) |
---|
41 | |
---|
42 | </p><pre class="screen"> |
---|
43 | <code class="prompt">$</code> <strong class="userinput"><code>svn checkout svn+ssh://<em class="replaceable"><code>YOUR_LOGIN</code></em>@forge.ipsl.jussieu.fr/ipsl/forge/projets/varamma/svn/trunk ~/varamma</code></strong> |
---|
44 | </pre><p> |
---|
45 | </p> |
---|
46 | </div> |
---|
47 | |
---|
48 | <div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="update"/>3. Update varamma</h2></div></div></div> |
---|
49 | |
---|
50 | |
---|
51 | <p> |
---|
52 | To update everything, go to the directory where you installed varamma (for example <code class="filename">~/varamma</code>) and execute |
---|
53 | |
---|
54 | </p><pre class="screen"> |
---|
55 | <code class="prompt">$</code> <strong class="userinput"><code>svn update</code></strong> |
---|
56 | </pre><p> |
---|
57 | </p> |
---|
58 | |
---|
59 | <p> |
---|
60 | You can also specify varamma when calling svn update, for example: |
---|
61 | |
---|
62 | </p><pre class="screen"> |
---|
63 | <code class="prompt">$</code> <strong class="userinput"><code>svn update ~/varamma</code></strong> |
---|
64 | </pre><p> |
---|
65 | </p> |
---|
66 | |
---|
67 | <p> |
---|
68 | Or you can specify one or several files you want to update |
---|
69 | |
---|
70 | </p><pre class="screen"> |
---|
71 | <code class="prompt">$</code> <strong class="userinput"><code>svn update ~/varamma/src/*.m</code></strong> |
---|
72 | </pre><p> |
---|
73 | </p> |
---|
74 | |
---|
75 | </div> |
---|
76 | <div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="compare"/>4. Compare your version with the reference deposit</h2></div></div></div> |
---|
77 | |
---|
78 | <p> |
---|
79 | To compare your version with the reference deposit as it was at the time you download (or updated) varamma, execute: |
---|
80 | |
---|
81 | </p><pre class="screen"> |
---|
82 | <code class="prompt">$</code> <strong class="userinput"><code>svn status</code></strong> |
---|
83 | </pre><p> |
---|
84 | </p> |
---|
85 | |
---|
86 | <p> |
---|
87 | To compare your version with the latest version of the reference deposit, execute: |
---|
88 | |
---|
89 | </p><pre class="screen"> |
---|
90 | <code class="prompt">$</code> <strong class="userinput"><code>svn status -u</code></strong> |
---|
91 | </pre><p> |
---|
92 | </p> |
---|
93 | |
---|
94 | </div> |
---|
95 | <div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="addfile"/>5. Add a new file</h2></div></div></div> |
---|
96 | |
---|
97 | |
---|
98 | <p> |
---|
99 | Add a new file to varamma |
---|
100 | |
---|
101 | </p><pre class="screen"> |
---|
102 | <code class="prompt">$</code> <strong class="userinput"><code>svn add <em class="replaceable"><code>file_name</code></em></code></strong> |
---|
103 | </pre><p> |
---|
104 | </p> |
---|
105 | |
---|
106 | <p> |
---|
107 | If <em class="replaceable"><code>file_name</code></em> is not in the working space (here ~/varamma), you must copy it. |
---|
108 | For example : |
---|
109 | </p><pre class="screen"> |
---|
110 | <code class="prompt">$</code> <strong class="userinput"><code>cp -p <em class="replaceable"><code>another_directory</code></em> ~/varamma/</code></strong> |
---|
111 | </pre><p> |
---|
112 | </p> |
---|
113 | |
---|
114 | <p> |
---|
115 | For example, directly |
---|
116 | |
---|
117 | </p><pre class="screen"> |
---|
118 | <code class="prompt">$</code> <strong class="userinput"><code>touch aaa</code></strong> <em class="lineannotation"><span class="lineannotation">create a <code class="filename">aaa</code> file</span></em> |
---|
119 | <code class="prompt">$</code> <strong class="userinput"><code>ls -l aaa</code></strong> |
---|
120 | <code class="computeroutput"> |
---|
121 | -rw-r--r-- 1 smasson lodyc 0 Oct 29 09:59 aaa |
---|
122 | </code> |
---|
123 | <code class="prompt">$</code> <strong class="userinput"><code>svn status</code></strong> <em class="lineannotation"><span class="lineannotation">check your deposit, <code class="filename">aaa</code> file is signaled as unknown</span></em> |
---|
124 | <code class="computeroutput"> |
---|
125 | ? aaa |
---|
126 | </code> |
---|
127 | <code class="prompt">$</code> <strong class="userinput"><code>svn add aaa</code></strong> <em class="lineannotation"><span class="lineannotation">add <code class="filename">aaa</code> file to the svn deposit</span></em> |
---|
128 | |
---|
129 | <code class="computeroutput"> |
---|
130 | A aaa |
---|
131 | </code> |
---|
132 | <code class="prompt">$</code> <strong class="userinput"><code>svn status</code></strong> <em class="lineannotation"><span class="lineannotation">check that <code class="filename">aaa</code> has been add to the deposit</span></em> |
---|
133 | <code class="computeroutput"> |
---|
134 | A aaa |
---|
135 | </code> |
---|
136 | </pre><p> |
---|
137 | </p> |
---|
138 | |
---|
139 | </div> |
---|
140 | <div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="createdir"/>6. Create a directory file</h2></div></div></div> |
---|
141 | |
---|
142 | <p> |
---|
143 | </p><pre class="screen"> |
---|
144 | <code class="prompt">$</code> <strong class="userinput"><code>svn mkdir <em class="replaceable"><code>directory_name</code></em></code></strong> |
---|
145 | </pre><p> |
---|
146 | </p> |
---|
147 | |
---|
148 | <p> |
---|
149 | For example: |
---|
150 | |
---|
151 | </p><pre class="screen"> |
---|
152 | <code class="prompt">$</code> <strong class="userinput"><code>svn mkdir AAA</code></strong> <em class="lineannotation"><span class="lineannotation">create the directory and add it to the svn deposit in one unique command</span></em> |
---|
153 | <code class="computeroutput"> |
---|
154 | A AAA |
---|
155 | </code> |
---|
156 | </pre><p> |
---|
157 | </p> |
---|
158 | |
---|
159 | <p> |
---|
160 | or |
---|
161 | |
---|
162 | </p><pre class="screen"> |
---|
163 | <code class="prompt">$</code> <strong class="userinput"><code>mkdir AAA</code></strong> <em class="lineannotation"><span class="lineannotation">create the directory</span></em> |
---|
164 | <code class="prompt">$</code> <strong class="userinput"><code>svn status</code></strong> <em class="lineannotation"><span class="lineannotation">check your deposit, <code class="filename">AAA</code> is signaled as unknown</span></em> |
---|
165 | <code class="computeroutput"> |
---|
166 | ? AAA |
---|
167 | </code> |
---|
168 | |
---|
169 | <code class="prompt">$</code> <strong class="userinput"><code>svn add AAA</code></strong> <em class="lineannotation"><span class="lineannotation">add it to the svn deposit</span></em> |
---|
170 | <code class="computeroutput"> |
---|
171 | A AAA |
---|
172 | </code> |
---|
173 | </pre><p> |
---|
174 | </p> |
---|
175 | |
---|
176 | </div> |
---|
177 | <div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="deletefile"/>7. Delete an existing file</h2></div></div></div> |
---|
178 | |
---|
179 | |
---|
180 | <p> |
---|
181 | </p><pre class="screen"> |
---|
182 | <code class="prompt">$</code> <strong class="userinput"><code>svn rm --force aaa</code></strong> <em class="lineannotation"><span class="lineannotation">works for file or directory</span></em> |
---|
183 | </pre><p> |
---|
184 | </p> |
---|
185 | |
---|
186 | </div> |
---|
187 | <div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="addversion"/>8. Add automatic version number in a file</h2></div></div></div> |
---|
188 | |
---|
189 | |
---|
190 | <p> |
---|
191 | Edit you file and add somewhere: |
---|
192 | |
---|
193 | </p><pre class="programlisting"> |
---|
194 | $Id$ |
---|
195 | </pre><p> |
---|
196 | </p> |
---|
197 | |
---|
198 | <p> |
---|
199 | Next execute the following svn command: |
---|
200 | |
---|
201 | </p><pre class="screen"> |
---|
202 | <code class="prompt">$</code> <strong class="userinput"><code>svn propset svn:keywords Id <em class="replaceable"><code>YOUR_FILE_NAME</code></em></code></strong> |
---|
203 | </pre><p> |
---|
204 | </p> |
---|
205 | |
---|
206 | <p> |
---|
207 | Next time you download/update you file, <code class="literal">$Id$</code> will be automatically replaced by the version tag. |
---|
208 | </p> |
---|
209 | </div> |
---|
210 | |
---|
211 | <div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="commit"/>9. Commit your changes</h2></div></div></div> |
---|
212 | |
---|
213 | |
---|
214 | <p> |
---|
215 | Commit all your changes with one command |
---|
216 | |
---|
217 | </p><pre class="screen"> |
---|
218 | <code class="prompt">$</code> <strong class="userinput"><code>svn commit --username <em class="replaceable"><code>YOUR_LOGIN</code></em> --message "A SHORT DESCRIPTION" ~/varamma</code></strong> |
---|
219 | </pre><p> |
---|
220 | </p> |
---|
221 | |
---|
222 | <p> |
---|
223 | or commit your change on one specific file (for example <code class="filename">~/varamma/src/aaa</code>) |
---|
224 | |
---|
225 | </p><pre class="screen"> |
---|
226 | <code class="prompt">$</code> <strong class="userinput"><code>svn commit --username <em class="replaceable"><code>YOUR_LOGIN</code></em> --message "A SHORT DESCRIPTION" ~/varamma/src/aaa</code></strong> |
---|
227 | </pre><p> |
---|
228 | </p> |
---|
229 | |
---|
230 | </div> |
---|
231 | <div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="version"/>10. More info on your version</h2></div></div></div> |
---|
232 | |
---|
233 | <p> |
---|
234 | </p><pre class="screen"> |
---|
235 | <code class="prompt">$</code> <strong class="userinput"><code>svn info ~/varamma</code></strong> |
---|
236 | </pre><p> |
---|
237 | </p> |
---|
238 | </div> |
---|
239 | </div> |
---|
240 | </body> |
---|
241 | </html> |
---|