source: trunk/adm/guides/svnbasiccommands.xml @ 5

Last change on this file since 5 was 5, checked in by pinsard, 15 years ago

add cp recipe

  • Property svn:keywords set to Id
File size: 6.9 KB
Line 
1<?xml version="1.0" encoding="iso-8859-1"?>
2<!DOCTYPE article [
3<!ENTITY % isolat1 SYSTEM "http://www.w3.org/2003/entities/iso8879/isolat1.ent">
4%isolat1;
5<!ENTITY % isolat2 SYSTEM "http://www.w3.org/2003/entities/iso8879/isolat2.ent">
6%isolat2;
7<!ENTITY % isogrk3 SYSTEM "http://www.w3.org/2003/entities/iso8879/isogrk3.ent">
8%isogrk3;
9<!ENTITY % isopub SYSTEM "http://www.w3.org/2003/entities/iso8879/isopub.ent">
10%isopub;
11<!ENTITY % isotech SYSTEM "http://www.w3.org/2003/entities/iso8879/isotech.ent">
12%isotech;
13<!ENTITY % isonum SYSTEM "http://www.w3.org/2003/entities/iso8879/isonum.ent">
14%isonum;
15<!ENTITY project "varamma">
16]>
17<!--
18
19
20/usr/home/fplod/incas/varamma/varamma_ws/adm/guides/svnbasiccommands.xml sur aedon.locean-ipsl.upmc.fr
21
22fplod 2008-12-09T14:16:01Z aedon.locean-ipsl.upmc.fr (Darwin)
23
24XML/DocBook migration of http://forge.ipsl.jussieu.fr/statpacksaxo/wiki/SvnBasicCommands from Sébastien Masson
25
26-->
27<article version="5.0"
28xmlns="http://docbook.org/ns/docbook"
29xmlns:xl="http://www.w3.org/1999/xlink"
30xml:lang="en">
31<title><command>svn</command> basic commands</title>
32  <info>
33    <authorgroup>
34      <author><personname><firstname>Sébastien</firstname> <surname>Masson</surname></personname> <email>Sebastien.Masson_at_locean-ipsl.upmc.fr</email></author>
35    </authorgroup>
36 <pubdate>$Id$</pubdate>
37</info>
38
39<sect1 xml:id="help">
40<title><command>svn</command> help</title>
41<para>
42<screen>
43 <prompt>$</prompt> <userinput>svn help</userinput>
44</screen>
45</para>
46
47<para>
48Help on a specific command (for example <command>add</command>):
49
50<screen>
51 <prompt>$</prompt> <userinput>svn help add </userinput>
52</screen>
53</para>
54
55</sect1>
56<sect1 xml:id="download">
57<title>Download &project;</title>
58
59<para>
60To download &project; in the directory <filename class="directory">~/&project;</filename> execute (with the appropriate login)
61
62<screen>
63 <prompt>$</prompt> <userinput>svn checkout svn+ssh://<replaceable>YOUR_LOGIN</replaceable>@forge.ipsl.jussieu.fr/ipsl/forge/projets/&project;/svn/trunk ~/&project;</userinput>
64</screen>
65</para>
66</sect1>
67
68<sect1 xml:id="update">
69<title>Update &project;</title>
70
71<para>
72To update everything, go to the directory where you installed &project; (for example <filename class="directory">~/&project;</filename>) and execute
73
74<screen>
75 <prompt>$</prompt> <userinput>svn update</userinput>
76</screen>
77</para>
78
79<para>
80You can also specify &project; when calling svn update, for example:
81
82<screen>
83 <prompt>$</prompt> <userinput>svn update ~/&project;</userinput>
84</screen>
85</para>
86
87<para>
88Or you can specify one or several files you want to update
89
90<screen>
91 <prompt>$</prompt> <userinput>svn update ~/&project;/src/*.m</userinput>
92</screen>
93</para>
94
95</sect1>
96<sect1 xml:id="compare">
97<title>Compare your version with the reference deposit</title>
98<para>
99To compare your version with the reference deposit as it was at the time you download (or updated) &project;, execute:
100
101<screen>
102 <prompt>$</prompt> <userinput>svn status</userinput>
103</screen>
104</para>
105
106<para>
107To compare your version with the latest version of the reference deposit, execute:
108
109<screen>
110 <prompt>$</prompt> <userinput>svn status -u</userinput>
111</screen>
112</para>
113
114</sect1>
115<sect1 xml:id="addfile">
116<title>Add a new file</title>
117
118<para>
119Add a new file to &project;
120
121<screen>
122 <prompt>$</prompt> <userinput>svn add <replaceable>file_name</replaceable></userinput>
123</screen>
124</para>
125
126<para>
127If <replaceable>file_name</replaceable> is not in the working space (here ~/&project;), you must copy it.
128For example :
129<screen>
130 <prompt>$</prompt> <userinput>cp -p <replaceable>another_directory</replaceable
131> ~/&project;/</userinput>
132</screen>
133</para>
134
135<para>
136For example, directly
137
138<screen>
139 <prompt>$</prompt> <userinput>touch aaa</userinput> <lineannotation>create a <filename>aaa</filename> file</lineannotation>
140 <prompt>$</prompt> <userinput>ls -l aaa</userinput>
141<computeroutput>
142-rw-r--r-- 1 smasson lodyc 0 Oct 29 09:59 aaa
143</computeroutput>
144 <prompt>$</prompt> <userinput>svn status</userinput> <lineannotation>check your deposit, <filename>aaa</filename> file is signaled as unknown</lineannotation>
145<computeroutput>
146?      aaa
147</computeroutput>
148 <prompt>$</prompt> <userinput>svn add aaa</userinput> <lineannotation>add <filename>aaa</filename> file to the svn deposit</lineannotation>
149
150<computeroutput>
151A         aaa
152</computeroutput>
153 <prompt>$</prompt> <userinput>svn status</userinput> <lineannotation>check that <filename>aaa</filename> has been add to the deposit</lineannotation>
154<computeroutput>
155A      aaa
156</computeroutput>
157</screen>
158</para>
159
160</sect1>
161<sect1 xml:id="createdir">
162<title>Create a directory file</title>
163<para>
164<screen>
165 <prompt>$</prompt> <userinput>svn mkdir <replaceable>directory_name</replaceable></userinput>
166</screen>
167</para>
168
169<para>
170For example:
171
172<screen>
173 <prompt>$</prompt> <userinput>svn mkdir AAA</userinput> <lineannotation>create the directory and add it to the svn deposit in one unique command</lineannotation>
174<computeroutput>
175A         AAA
176</computeroutput>
177</screen>
178</para>
179
180<para>
181or
182
183<screen>
184 <prompt>$</prompt> <userinput>mkdir AAA</userinput> <lineannotation>create the directory</lineannotation>
185 <prompt>$</prompt> <userinput>svn status</userinput> <lineannotation>check your deposit, <filename class="directory">AAA</filename> is signaled as unknown</lineannotation>
186<computeroutput>
187?      AAA
188</computeroutput>
189
190 <prompt>$</prompt> <userinput>svn add AAA</userinput> <lineannotation>add it to the svn deposit</lineannotation>
191<computeroutput>
192A         AAA
193</computeroutput>
194</screen>
195</para>
196
197</sect1>
198<sect1 xml:id="deletefile">
199<title>Delete an existing file</title>
200
201<para>
202<screen>
203 <prompt>$</prompt> <userinput>svn rm --force aaa</userinput> <lineannotation>works for file or directory</lineannotation>
204</screen>
205</para>
206
207</sect1>
208<sect1 xml:id="addversion">
209<title>Add automatic version number in a file</title>
210
211<para>
212Edit you file and add somewhere:
213
214<programlisting>
215&dollar;Id&dollar;
216</programlisting>
217</para>
218
219<para>
220Next execute the following svn command:
221
222<screen>
223 <prompt>$</prompt> <userinput>svn propset svn:keywords Id <replaceable>YOUR_FILE_NAME</replaceable></userinput>
224</screen>
225</para>
226
227<para>
228Next time you download/update you file, <literal>&dollar;Id&dollar;</literal> will be automatically replaced by the version tag.
229</para>
230</sect1>
231
232<sect1 xml:id="commit">
233<title>Commit your changes</title>
234
235<para>
236Commit all your changes with one command
237
238<screen>
239 <prompt>$</prompt> <userinput>svn commit --username <replaceable>YOUR_LOGIN</replaceable> --message "A SHORT DESCRIPTION" ~/&project;</userinput>
240</screen>
241</para>
242
243<para>
244or commit your change on one specific file (for example <filename>~/&project;/src/aaa</filename>)
245
246<screen>
247 <prompt>$</prompt> <userinput>svn commit --username <replaceable>YOUR_LOGIN</replaceable> --message "A SHORT DESCRIPTION" ~/&project;/src/aaa</userinput>
248</screen>
249</para>
250
251</sect1>
252<sect1 xml:id="version">
253<title> More info on your version</title>
254<para>
255<screen>
256 <prompt>$</prompt> <userinput>svn info ~/&project;</userinput>
257</screen>
258</para>
259</sect1>
260</article>
Note: See TracBrowser for help on using the repository browser.