OSDN Git Service

Merge branch 'master' of git://repo.or.cz/TortoiseGit
[tortoisegit/TortoiseGitJp.git] / doc / source / en / TortoiseGit / tsvn_app_cli.xml
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE appendix SYSTEM "../../dtd/dblite.dtd">\r
3 <appendix id="tsvn-cli" xmlns:xi="http://www.w3.org/2001/XInclude">\r
4         <title>Command Line Interface Cross Reference</title>\r
5         <simplesect>\r
6                 <indexterm>\r
7                         <primary>command line client</primary>\r
8                 </indexterm>\r
9                 <indexterm>\r
10                         <primary>CLI</primary>\r
11                 </indexterm>\r
12                 <para>\r
13                         Sometimes this manual refers you to the main Git\r
14                         documentation, which describes Git in terms of the\r
15                         Command Line Interface (CLI). To help you understand what\r
16                         TortoiseGit is doing behind the scenes, we have compiled\r
17                         a list showing the equivalent CLI commands for each of\r
18                         TortoiseGit's GUI operations.\r
19                 </para>\r
20                 <note>\r
21                         <para>\r
22                         Even though there are CLI equivalents to what TortoiseGit\r
23                         does, remember that TortoiseGit does <emphasis>not</emphasis>\r
24                         call the CLI but uses the Git library directly.\r
25                         </para>\r
26                 </note>\r
27                 <para>\r
28                         If you think you have found a bug in TortoiseGit, we\r
29                         may ask you to try to reproduce it using the CLI, so\r
30                         that we can distinguish TortoiseGit issues from Git\r
31                         issues. This reference tells you which command to try.\r
32                 </para>\r
33         </simplesect>\r
34         <sect1 id="tsvn-cli-basics">\r
35                 <title>Conventions and Basic Rules</title>\r
36                 <para>\r
37                         In the descriptions which follow, the URL for a repository\r
38                         location is shown simply as\r
39                         <literal>URL</literal>, and an example might be\r
40                         <systemitem class="url">http://TortoiseGit.tigris.org/svn/TortoiseGit/trunk</systemitem>.\r
41                         The working copy path is shown simply as\r
42                         <literal>PATH</literal>, and an example might be\r
43                         <filename>C:\TortoiseGit\trunk</filename>.\r
44                 </para>\r
45                 <important>\r
46                         <para>\r
47                         Because TortoiseGit is a Windows Shell Extension, it is not able\r
48                         to use the notion of a current working directory. All working\r
49                         copy paths must be given using the absolute path, not a relative\r
50                         path.\r
51                         </para>\r
52                 </important>\r
53                 <para>\r
54                         Certain items are optional, and these are often controlled by\r
55                         checkboxes or radio buttons in TortoiseGit. These options are\r
56                         shown in [square brackets] in the command line definitions.\r
57                 </para>\r
58         </sect1>\r
59         <sect1 id="tsvn-cli-main">\r
60                 <title>TortoiseGit Commands</title>\r
61                 <sect2 id="tsvn-cli-checkout">\r
62                         <title>Checkout</title>\r
63 <screen>\r
64 svn checkout [-N] [--ignore-externals] [-r rev] URL PATH\r
65 </screen>\r
66                         <para>\r
67                                 If <guilabel>Only checkout the top folder</guilabel> is checked,\r
68                                 use the <literal>-N</literal> switch.\r
69                         </para>\r
70                         <para>\r
71                                 If <guilabel>Omit externals</guilabel> is checked,\r
72                                 use the <literal>--ignore-externals</literal> switch.\r
73                         </para>\r
74                         <para>\r
75                                 If you are checking out a specific revision, specify that\r
76                                 after the URL using <literal>-r</literal> switch.\r
77                         </para>\r
78                 </sect2>\r
79                 <sect2 id="tsvn-cli-update">\r
80                         <title>Update</title>\r
81 <screen>\r
82 svn info URL_of_WC\r
83 svn update [-r rev] PATH\r
84 </screen>\r
85                         <para>\r
86                                 Updating multiple items is currently not an atomic operation\r
87                                 in Git. So\r
88                                 TortoiseGit first finds the HEAD revision of the repository,\r
89                                 and then updates all items to that particular revision number to\r
90                                 avoid creating a mixed revision working copy.\r
91                         </para>\r
92                         <para>\r
93                                 If only one item is selected for updating or the selected items are\r
94                                 not all from the same repository, TortoiseGit just updates\r
95                         to HEAD.\r
96                         </para>\r
97                         <para>\r
98                                 No command line options are used here.\r
99                                 <guilabel>Update to revision</guilabel> also implements\r
100                                 the update command, but offers more options.\r
101                         </para>\r
102                 </sect2>\r
103                 <sect2 id="tsvn-cli-updaterev">\r
104                         <title>Update to Revision</title>\r
105 <screen>\r
106 svn info URL_of_WC\r
107 svn update [-r rev] [-N] [--ignore-externals] PATH\r
108 </screen>\r
109                         <para>\r
110                                 If <guilabel>Only update the top folder</guilabel> is checked,\r
111                                 use the <literal>-N</literal> switch.\r
112                         </para>\r
113                         <para>\r
114                                 If <guilabel>Omit externals</guilabel> is checked,\r
115                                 use the <literal>--ignore-externals</literal> switch.\r
116                         </para>\r
117                 </sect2>\r
118                 <sect2 id="tsvn-cli-commit">\r
119                         <title>Commit</title>\r
120                         <para>\r
121                                 In TortoiseGit, the commit dialog uses several Git commands.\r
122                                 The first stage is a status check which determines the items\r
123                                 in your working copy which can potentially be committed. You can\r
124                                 review the list, diff files against BASE and select the items you\r
125                                 want to be included in the commit.\r
126                         </para>\r
127 <screen>\r
128 svn status -v PATH\r
129 </screen>\r
130                         <para>\r
131                                 If <guilabel>Show unversioned files</guilabel> is checked,\r
132                                 TortoiseGit will also show all unversioned files and folders in\r
133                                 the working copy hierarchy, taking account of the ignore rules.\r
134                                 This particular feature has no direct equivalent in Git,\r
135                                 as the <literal>svn status</literal> command does not descend into\r
136                                 unversioned folders.\r
137                         </para>\r
138                         <para>\r
139                                 If you check any unversioned files and folders, those items will\r
140                                 first be added to your working copy.\r
141                         </para>\r
142 <screen>\r
143 svn add PATH...\r
144 </screen>\r
145                         <para>\r
146                                 When you click on OK, the Git commit takes place. If you have\r
147                                 left all the file selection checkboxes in their default state,\r
148                                 TortoiseGit uses a single recursive commit of the working copy.\r
149                                 If you deselect some files, then a non-recursive commit\r
150                                 (<literal>-N</literal>) must be used, and every path must be\r
151                                 specified individually on the commit command line.\r
152                         </para>\r
153 <screen>\r
154 svn commit -m "LogMessage" [-N] [--no-unlock] PATH...\r
155 </screen>\r
156                         <para>\r
157                                 <literal>LogMessage</literal> here represents the contents of the\r
158                                 log message edit box. This can be empty.\r
159                         </para>\r
160                         <para>\r
161                                 If <guilabel>Keep locks</guilabel> is checked,\r
162                                 use the <literal>--no-unlock</literal> switch.\r
163                         </para>\r
164                 </sect2>\r
165                 <sect2 id="tsvn-cli-diff">\r
166                         <title>Diff</title>\r
167 <screen>\r
168 svn diff PATH\r
169 </screen>\r
170                         <para>\r
171                                 If you use Diff from the main context menu, you are diffing\r
172                                 a modified file against its BASE revision. The output from\r
173                                 the CLI command above also does this and produces output\r
174                                 in unified-diff format. However, this is not what TortoiseGit\r
175                                 is using. TortoiseGit uses TortoiseMerge (or a diff program of\r
176                                 your choosing) to display differences visually between\r
177                                 full-text files, so there is no direct CLI equivalent.\r
178                         </para>\r
179                         <para>\r
180                                 You can also diff any 2 files using TortoiseGit, whether or\r
181                                 not they are version controlled. TortoiseGit just feeds the\r
182                                 two files into the chosen diff program and lets it work out\r
183                                 where the differences lie.\r
184                         </para>\r
185                 </sect2>\r
186                 <sect2 id="tsvn-cli-showlog">\r
187                         <title>Show Log</title>\r
188 <screen>\r
189 svn log -v -r 0:N --limit 100 [--stop-on-copy] PATH\r
190   or\r
191 svn log -v -r M:N [--stop-on-copy] PATH\r
192 </screen>\r
193                         <para>\r
194                                 By default, TortoiseGit tries to fetch 100 log messages\r
195                                 using the --limit method. If the settings instruct it to\r
196                                 use old APIs, then the second form is used to fetch the\r
197                                 log messages for 100 repository revisions.\r
198                         </para>\r
199                         <para>\r
200                                 If <guilabel>Stop on copy/rename</guilabel> is checked,\r
201                                 use the <literal>--stop-on-copy</literal> switch.\r
202                         </para>\r
203                 </sect2>\r
204                 <sect2 id="tsvn-cli-checkmods">\r
205                         <title>Check for Modifications</title>\r
206 <screen>\r
207 svn status -v PATH\r
208   or\r
209 svn status -u -v PATH\r
210 </screen>\r
211                         <para>\r
212                                 The initial status check looks only at your working copy.\r
213                                 If you click on <guibutton>Check repository</guibutton>\r
214                                 then the repository is also checked to see which files\r
215                                 would be changed by an update, which requires the\r
216                                 <literal>-u</literal> switch.\r
217                         </para>\r
218                         <para>\r
219                                 If <guilabel>Show unversioned files</guilabel> is checked,\r
220                                 TortoiseGit will also show all unversioned files and folders in\r
221                                 the working copy hierarchy, taking account of the ignore rules.\r
222                                 This particular feature has no direct equivalent in Git,\r
223                                 as the <literal>svn status</literal> command does not descend into\r
224                                 unversioned folders.\r
225                         </para>\r
226                 </sect2>\r
227                 <sect2 id="tsvn-cli-revgraph">\r
228                         <title>Revision Graph</title>\r
229                         <para>\r
230                                 The revision graph is a feature of TortoiseGit only. There's no\r
231                                 equivalent in the command line client.\r
232                         </para>\r
233                         <para>\r
234                                 What TortoiseGit does is an\r
235 <screen>\r
236 svn info URL_of_WC\r
237 svn log -v URL\r
238 </screen>\r
239                                 where URL is the repository <emphasis>root</emphasis> and then\r
240                                 analyzes the data returned.\r
241                         </para>\r
242                 </sect2>\r
243                 <sect2 id="tsvn-cli-repobrowser">\r
244                         <title>Repo Browser</title>\r
245 <screen>\r
246 svn info URL_of_WC\r
247 svn list [-r rev] -v URL\r
248 </screen>\r
249                         <para>\r
250                                 You can use <literal>svn info</literal> to determine the repository\r
251                                 root, which is the top level shown in the repository browser. You\r
252                                 cannot navigate <literal>Up</literal> above this level.\r
253                                 Also, this command returns all the locking information shown in\r
254                                 the repository browser.\r
255                         </para>\r
256                         <para>\r
257                                 The <literal>svn list</literal> call will list the contents of a\r
258                                 directory, given a URL and revision.\r
259                         </para>\r
260                 </sect2>\r
261                 <sect2 id="tsvn-cli-editconflicts">\r
262                         <title>Edit Conflicts</title>\r
263                         <para>\r
264                                 This command has no CLI equivalent. It invokes TortoiseMerge or\r
265                                 an external 3-way diff/merge tool to look at the files involved\r
266                                 in the conflict and sort out which lines to use.\r
267                         </para>\r
268                 </sect2>\r
269                 <sect2 id="tsvn-cli-resolved">\r
270                         <title>Resolved</title>\r
271 <screen>\r
272 svn resolved PATH\r
273 </screen>\r
274                 </sect2>\r
275                 <sect2 id="tsvn-cli-rename">\r
276                         <title>Rename</title>\r
277 <screen>\r
278 svn rename CURR_PATH NEW_PATH\r
279 </screen>\r
280                 </sect2>\r
281                 <sect2 id="tsvn-cli-delete">\r
282                         <title>Delete</title>\r
283 <screen>\r
284 svn delete PATH\r
285 </screen>\r
286                 </sect2>\r
287                 <sect2 id="tsvn-cli-revert">\r
288                         <title>Revert</title>\r
289 <screen>\r
290 svn status -v PATH\r
291 </screen>\r
292                         <para>\r
293                                 The first stage is a status check which determines the items\r
294                                 in your working copy which can potentially be reverted. You can\r
295                                 review the list, diff files against BASE and select the items you\r
296                                 want to be included in the revert.\r
297                         </para>\r
298                         <para>\r
299                                 When you click on OK, the Git revert takes place. If you have\r
300                                 left all the file selection checkboxes in their default state,\r
301                                 TortoiseGit uses a single recursive (<literal>-R</literal>)\r
302                                 revert of the working copy. If you deselect some files, then\r
303                                 every path must be specified individually on the revert command line.\r
304                         </para>\r
305 <screen>\r
306 svn revert [-R] PATH...\r
307 </screen>\r
308                 </sect2>\r
309                 <sect2 id="tsvn-cli-cleanup">\r
310                         <title>Cleanup</title>\r
311 <screen>\r
312 svn cleanup PATH\r
313 </screen>\r
314                 </sect2>\r
315                 <sect2 id="tsvn-cli-getlock">\r
316                         <title>Get Lock</title>\r
317 <screen>\r
318 svn status -v PATH\r
319 </screen>\r
320                         <para>\r
321                                 The first stage is a status check which determines the files\r
322                                 in your working copy which can potentially be locked. You can\r
323                                 select the items you want to be locked.\r
324                         </para>\r
325 <screen>\r
326 svn lock -m "LockMessage" [--force] PATH...\r
327 </screen>\r
328                         <para>\r
329                                 <literal>LockMessage</literal> here represents the contents of the\r
330                                 lock message edit box. This can be empty.\r
331                         </para>\r
332                         <para>\r
333                                 If <guilabel>Steal the locks</guilabel> is checked,\r
334                                 use the <literal>--force</literal> switch.\r
335                         </para>\r
336                 </sect2>\r
337                 <sect2 id="tsvn-cli-release">\r
338                         <title>Release Lock</title>\r
339 <screen>\r
340 svn unlock PATH\r
341 </screen>\r
342                 </sect2>\r
343                 <sect2 id="tsvn-cli-branchtag">\r
344                         <title>Branch/Tag</title>\r
345 <screen>\r
346 svn copy -m "LogMessage" URL URL\r
347   or\r
348 svn copy -m "LogMessage" URL@rev URL@rev\r
349   or\r
350 svn copy -m "LogMessage" PATH URL\r
351 </screen>\r
352                         <para>\r
353                                 The Branch/Tag dialog performs a copy to the repository.\r
354                                 There are 3 radio button options:\r
355                                 <itemizedlist>\r
356                                         <listitem>HEAD revision in the repository</listitem>\r
357                                         <listitem>Specific revision in repository</listitem>\r
358                                         <listitem>Working copy</listitem>\r
359                                 </itemizedlist>\r
360                                 which correspond to the 3 command line variants above.\r
361                         </para>\r
362                         <para>\r
363                                 <literal>LogMessage</literal> here represents the contents of the\r
364                                 log message edit box. This can be empty.\r
365                         </para>\r
366                 </sect2>\r
367                 <sect2 id="tsvn-cli-switch">\r
368                         <title>Switch</title>\r
369 <screen>\r
370 svn info URL_of_WC\r
371 svn switch [-r rev] URL PATH\r
372 </screen>\r
373                 </sect2>\r
374                 <sect2 id="tsvn-cli-merge">\r
375                         <title>Merge</title>\r
376 <screen>\r
377 svn merge [--dry-run] --force From_URL@revN To_URL@revM PATH\r
378 </screen>\r
379                         <para>\r
380                                 The <guibutton>Test Merge</guibutton> performs the same merge\r
381                                 with the <literal>--dry-run</literal> switch.\r
382                         </para>\r
383 <screen>\r
384 svn diff From_URL@revN To_URL@revM\r
385 </screen>\r
386                         <para>\r
387                                 The <guibutton>Unified diff</guibutton> shows the diff\r
388                                 operation which will be used to do the merge.\r
389                         </para>\r
390                 </sect2>\r
391                 <sect2 id="tsvn-cli-export">\r
392                         <title>Export</title>\r
393 <screen>\r
394 svn export [-r rev] [--ignore-externals] URL Export_PATH\r
395 </screen>\r
396                         <para>\r
397                                 This form is used when accessed from an unversioned folder,\r
398                                 and the folder is used as the destination.\r
399                         </para>\r
400                         <para>\r
401                                 Exporting a working copy to a different location is done without\r
402                                 using the Git library, so there's no matching command\r
403                                 line equivalent.\r
404                         </para>\r
405                         <para>\r
406                                 What TortoiseGit does is to copy all files to the new location\r
407                                 while showing you the progress of the operation. Unversioned\r
408                                 files/folders can optionally be exported too.\r
409                         </para>\r
410                         <para>\r
411                                 In both cases,\r
412                                 if <guilabel>Omit externals</guilabel> is checked,\r
413                                 use the <literal>--ignore-externals</literal> switch.\r
414                         </para>\r
415                 </sect2>\r
416                 <sect2 id="tsvn-cli-relocate">\r
417                         <title>Relocate</title>\r
418 <screen>\r
419 svn switch --relocate From_URL To_URL\r
420 </screen>\r
421                 </sect2>\r
422                 <sect2 id="tsvn-cli-createrepos">\r
423                         <title>Create Repository Here</title>\r
424 <screen>\r
425 svnadmin create --fs-type fsfs PATH\r
426 </screen>\r
427                 </sect2>\r
428                 <sect2 id="tsvn-cli-add">\r
429                         <title>Add</title>\r
430 <screen>\r
431 svn add PATH...\r
432 </screen>\r
433                         <para>\r
434                                 If you selected a folder, TortoiseGit first scans it\r
435                                 recursively for items which can be added.\r
436                         </para>\r
437                 </sect2>\r
438                 <sect2 id="tsvn-cli-import">\r
439                         <title>Import</title>\r
440 <screen>\r
441 svn import -m LogMessage PATH URL\r
442 </screen>\r
443                         <para>\r
444                                 <literal>LogMessage</literal> here represents the contents of the\r
445                                 log message edit box. This can be empty.\r
446                         </para>\r
447                 </sect2>\r
448                 <sect2 id="tsvn-cli-blame">\r
449                         <title>Blame</title>\r
450 <screen>\r
451 svn blame -r N:M -v PATH\r
452 svn log -r N:M PATH\r
453 </screen>\r
454                         <para>\r
455                                 If you use TortoiseBlame to view the blame info, the file\r
456                                 log is also required to show log messages in a tooltip.\r
457                                 If you view blame as a text file, this information is not\r
458                                 required.\r
459                         </para>\r
460                 </sect2>\r
461                 <sect2 id="tsvn-cli-addignore">\r
462                         <title>Add to Ignore List</title>\r
463 <screen>\r
464 svn propget svn:ignore PATH > tempfile\r
465 {edit new ignore item into tempfile}\r
466 svn propset svn:ignore -F tempfile PATH\r
467 </screen>\r
468                         <para>\r
469                                 Because the <literal>svn:ignore</literal> property is often\r
470                                 a multi-line value, it is shown here as being changed via\r
471                                 a text file rather than directly on the command line.\r
472                         </para>\r
473                 </sect2>\r
474                 <sect2 id="tsvn-cli-createpatch">\r
475                         <title>Create Patch</title>\r
476 <screen>\r
477 svn diff PATH > patch-file\r
478 </screen>\r
479                         <para>\r
480                                 TortoiseGit creates a patch file in unified diff format\r
481                                 by comparing the working copy with its BASE version.\r
482                         </para>\r
483                 </sect2>\r
484                 <sect2 id="tsvn-cli-applypatch">\r
485                         <title>Apply Patch</title>\r
486                         <para>\r
487                                 Applying patches is a tricky business unless the patch\r
488                                 and working copy are at the same revision. Luckily for\r
489                                 you, you can use TortoiseMerge, which has no direct\r
490                                 equivalent in Git.\r
491                         </para>\r
492                 </sect2>\r
493         </sect1>\r
494 </appendix>\r
495 <!--\r
496 local variables: \r
497 sgml-parent-document: ("book.xml" "appendix")\r
498 end:\r
499 -->\r