1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE appendix SYSTEM "../../dtd/dblite.dtd">
\r
3 <appendix id="tsvn-automation">
\r
4 <title>Automating TortoiseGit</title>
\r
7 Since all commands for TortoiseGit are controlled through command
\r
8 line parameters, you can automate it with batch scripts or start specific
\r
9 commands and dialogs from other programs (e.g. your favourite text editor).
\r
13 Remember that TortoiseGit is a GUI client, and this automation guide
\r
14 shows you how to make the TortoiseGit dialogs appear to collect user
\r
15 input. If you want to write a script which requires no input, you should
\r
16 use the official Subversion command line client instead.
\r
20 <!-- ================================================================= -->
\r
21 <!-- ======================== SECTION 1 ============================== -->
\r
22 <!-- ================================================================= -->
\r
23 <sect1 id="tsvn-automation-basics">
\r
24 <title>TortoiseGit Commands</title>
\r
26 <primary>automation</primary>
\r
29 <primary>command line</primary>
\r
32 The TortoiseGit GUI program is called <literal>TortoiseProc.exe</literal>.
\r
33 All commands are specified with the parameter <option>/command:abcd</option>
\r
34 where <literal>abcd</literal> is the required command name. Most of these
\r
35 commands need at least one path argument, which is given with
\r
36 <option>/path:"some\path"</option>. In the following table the command
\r
37 refers to the <option>/command:abcd</option> parameter and the path
\r
38 refers to the <option>/path:"some\path"</option> parameter.
\r
41 Since some of the commands can take a list of target paths (e.g. committing
\r
42 several specific files) the <option>/path</option> parameter can take
\r
43 several paths, separated by a <literal>*</literal> character.
\r
46 TortoiseGit uses temporary files to pass multiple arguments between
\r
47 the shell extension and the main program. From TortoiseGit 1.5.0 on and later,
\r
48 <option>/notempfile</option> parameter is obsolete and there is no need
\r
52 The progress dialog which is used for commits, updates and many more commands
\r
53 usually stays open after the command has finished until the user presses
\r
54 the <guibutton>OK</guibutton> button. This can be changed by checking
\r
55 the corresponding option in the settings dialog. But using that setting
\r
56 will close the progress dialog, no matter if you start the command
\r
57 from your batch file or from the TortoiseGit context menu.
\r
60 To specify a different location of the configuration file, use the parameter
\r
61 <option>/configdir:"path\to\config\directory"</option>.
\r
62 This will override the default path, including any registry setting.
\r
65 To close the progress dialog at the end of a command automatically without
\r
66 using the permanent setting you can pass the <option>/closeonend</option>
\r
71 <option>/closeonend:0</option> don't close the dialog automatically
\r
76 <option>/closeonend:1</option> auto close if no errors
\r
81 <option>/closeonend:2</option> auto close if no errors and conflicts
\r
86 <option>/closeonend:3</option> auto close if no errors, conflicts and merges
\r
91 <option>/closeonend:4</option> auto close if no errors, conflicts and merges
\r
92 for local operations
\r
98 The table below lists all the commands which can be accessed
\r
99 using the TortoiseProc.exe command line. As described above,
\r
100 these should be used in the form <literal>/command:abcd</literal>.
\r
101 In the table, the <literal>/command</literal> prefix is omitted
\r
105 ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION
\r
106 Don't touch these lines:
\r
107 <entry condition="pot">:about</entry>
\r
109 The condition="pot" prevents the strings from being extracted into
\r
110 the .pot file, so nobody translates them.
\r
111 The colons in front of the command have to stay there to prevent these strings
\r
112 from being translated if the po file "by chance" contains a matching translation.
\r
115 <table id="tsvn-automation-1-table">
\r
116 <title>List of available commands and options</title>
\r
118 <colspec colnum="1" colwidth="2*"/>
\r
119 <colspec colnum="2" colwidth="6*"/>
\r
122 <entry>Command</entry>
\r
123 <entry>Description</entry>
\r
128 <entry condition="pot">:about</entry>
\r
130 Shows the about dialog. This is also shown if no
\r
135 <entry condition="pot">:log</entry>
\r
137 Opens the log dialog. The <option>/path</option> specifies the
\r
138 file or folder for which the log should be shown.
\r
139 Three additional options can be set:
\r
140 <option>/startrev:xxx</option>,
\r
141 <option>/endrev:xxx</option> and
\r
142 <option>/strict</option>
\r
146 <entry condition="pot">:checkout</entry>
\r
148 Opens the checkout dialog. The <option>/path</option>
\r
149 specifies the target directory and the <option>/url</option>
\r
150 specifies the URL to checkout from.
\r
154 <entry condition="pot">:import</entry>
\r
156 Opens the import dialog. The <option>/path</option>
\r
157 specifies the directory with the data to import.
\r
161 <entry condition="pot">:update</entry>
\r
163 Updates the working copy in <option>/path</option> to
\r
164 HEAD. If the option <option>/rev</option> is given
\r
165 then a dialog is shown to ask the user to which
\r
166 revision the update should go. To avoid the dialog
\r
167 specify a revision number <option>/rev:1234</option>.
\r
168 Other options are <option>/nonrecursive</option> and
\r
169 <option>/ignoreexternals</option>.
\r
173 <entry condition="pot">:commit</entry>
\r
175 Opens the commit dialog. The <option>/path</option> specifies the
\r
176 target directory or the list of files to commit.
\r
177 You can also specify the <option>/logmsg</option> switch
\r
178 to pass a predefined log message to the commit dialog.
\r
179 Or, if you don't want to pass the log message on the
\r
180 command line, use <option>/logmsgfile:path</option>,
\r
181 where <option>path</option>
\r
182 points to a file containing the log message.
\r
183 To pre-fill the bug ID box (in case you've set up
\r
184 integration with bug trackers properly), you can use
\r
185 the <option>/bugid:"the bug id here"</option> to
\r
190 <entry condition="pot">:add</entry>
\r
192 Adds the files in <option>/path</option> to
\r
197 <entry condition="pot">:revert</entry>
\r
199 Reverts local modifications of a working copy.
\r
200 The <option>/path</option> tells which items
\r
205 <entry condition="pot">:cleanup</entry>
\r
207 Cleans up interrupted or aborted operations and
\r
208 unlocks the working copy in <option>/path</option>.
\r
212 <entry condition="pot">:resolve</entry>
\r
214 Marks a conflicted file specified in
\r
215 <option>/path</option> as resolved. If
\r
216 <option>/noquestion</option> is given, then resolving
\r
217 is done without asking the user first if it really
\r
222 <entry condition="pot">:repocreate</entry>
\r
224 Creates a repository in <option>/path</option>
\r
228 <entry condition="pot">:switch</entry>
\r
230 Opens the switch dialog. The <option>/path</option> specifies the
\r
235 <entry condition="pot">:export</entry>
\r
237 Exports the working copy in <option>/path</option>
\r
238 to another directory. If the <option>/path</option>
\r
239 points to an unversioned directory, a dialog will ask
\r
240 for an URL to export to the directory in <option>/path</option>.
\r
244 <entry condition="pot">:merge</entry>
\r
246 Opens the merge dialog. The <option>/path</option> specifies the
\r
248 For merging a revision range, the following options are available:
\r
249 <option>/fromurl:URL</option>,
\r
250 <option>/revrange:string</option>.
\r
251 For merging two repository trees, the following options are available:
\r
252 <option>/fromurl:URL</option>,
\r
253 <option>/tourl:URL</option>,
\r
254 <option>/fromrev:xxx</option> and
\r
255 <option>/torev:xxx</option>.
\r
256 These pre-fill the relevant fields in the merge dialog.
\r
260 <entry condition="pot">:mergeall</entry>
\r
262 Opens the merge all dialog. The <option>/path</option> specifies the
\r
267 <entry condition="pot">:copy</entry>
\r
269 Brings up the branch/tag dialog.
\r
270 The <option>/path</option>
\r
271 is the working copy to branch/tag from.
\r
272 And the <option>/url</option> is the
\r
274 You can also specify the <option>/logmsg</option> switch
\r
275 to pass a predefined log message to the branch/tag dialog.
\r
276 Or, if you don't want to pass the log message on the
\r
277 command line, use <option>/logmsgfile:path</option>,
\r
278 where <option>path</option>
\r
279 points to a file containing the log message.
\r
283 <entry condition="pot">:settings</entry>
\r
285 Opens the settings dialog.
\r
289 <entry condition="pot">:remove</entry>
\r
291 Removes the file(s) in <option>/path</option> from
\r
296 <entry condition="pot">:rename</entry>
\r
298 Renames the file in <option>/path</option>. The new
\r
299 name for the file is asked with a dialog.
\r
300 To avoid the question about renaming similar files
\r
301 in one step, pass <option>/noquestion</option>.
\r
305 <entry condition="pot">:diff</entry>
\r
307 Starts the external diff program specified in the
\r
308 TortoiseGit settings. The <option>/path</option>
\r
309 specifies the first file.
\r
310 If the option <option>/path2</option>
\r
311 is set, then the diff program is started with those
\r
312 two files. If <option>/path2</option> is omitted,
\r
313 then the diff is done between the file in
\r
314 <option>/path</option> and its BASE.
\r
315 To explicitly set the revision numbers use
\r
316 <option>/startrev:xxx</option> and
\r
317 <option>/endrev:xxx</option>.
\r
318 If <option>/blame</option> is set and <option>/path2</option>
\r
319 is not set, then the diff is done by first blaming
\r
320 the files with the given revisions.
\r
324 <entry condition="pot">:showcompare</entry>
\r
327 Depending on the URLs and revisions to compare, this
\r
328 either shows a unified diff (if the option <option>unified</option> is set),
\r
329 a dialog with a list of files that have changed or if
\r
330 the URLs point to files starts the diff viewer for
\r
334 The options <option>url1</option>, <option>url2</option>,
\r
335 <option>revision1</option> and <option>revision2</option>
\r
336 must be specified. The options <option>pegrevision</option>,
\r
337 <option>ignoreancestry</option>, <option>blame</option> and
\r
338 <option>unified</option> are optional.
\r
343 <entry condition="pot">:conflicteditor</entry>
\r
345 Starts the conflict editor specified in the TortoiseGit
\r
346 settings with the correct files for the conflicted
\r
347 file in <option>/path</option>.
\r
351 <entry condition="pot">:relocate</entry>
\r
353 Opens the relocate dialog. The <option>/path</option>
\r
354 specifies the working copy path to relocate.
\r
358 <entry condition="pot">:help</entry>
\r
360 Opens the help file.
\r
364 <entry condition="pot">:repostatus</entry>
\r
366 Opens the check-for-modifications dialog. The <option>/path</option>
\r
367 specifies the working copy directory.
\r
371 <entry condition="pot">:repobrowser</entry>
\r
373 Starts the repository browser dialog, pointing to
\r
374 the URL of the working copy given in
\r
375 <option>/path</option> or <option>/path</option>
\r
376 points directly to an URL.
\r
377 An additional option <option>/rev:xxx</option> can
\r
378 be used to specify the revision which the repository
\r
379 browser should show. If the <option>/rev:xxx</option>
\r
380 is omitted, it defaults to HEAD.
\r
381 If <option>/path</option> points to an URL, the
\r
382 <option>/projectpropertiespath:path/to/wc</option> specifies
\r
383 the path from where to read and use the project properties.
\r
387 <entry condition="pot">:ignore</entry>
\r
389 Adds all targets in <option>/path</option> to the
\r
390 ignore list, i.e. adds the <literal>svn:ignore</literal>
\r
391 property to those files.
\r
395 <entry condition="pot">:blame</entry>
\r
398 Opens the blame dialog for the file specified
\r
399 in <option>/path</option>.
\r
402 If the options <option>/startrev</option> and
\r
403 <option>/endrev</option> are set, then the dialog
\r
404 asking for the blame range is not shown but
\r
405 the revision values of those options are used
\r
409 If the option <option>/line:nnn</option> is set,
\r
410 TortoiseBlame will open with the specified line
\r
414 The options <option>/ignoreeol</option>,
\r
415 <option>/ignorespaces</option> and
\r
416 <option>/ignoreallspaces</option> are also supported.
\r
421 <entry condition="pot">:cat</entry>
\r
423 Saves a file from an URL or working copy path given
\r
424 in <option>/path</option> to the location given in
\r
425 <option>/savepath:path</option>. The revision is
\r
426 given in <option>/revision:xxx</option>. This can
\r
427 be used to get a file with a specific revision.
\r
431 <entry condition="pot">:createpatch</entry>
\r
433 Creates a patch file for the path given in
\r
434 <option>/path</option>.
\r
438 <entry condition="pot">:revisiongraph</entry>
\r
440 Shows the revision graph for the path given in
\r
441 <option>/path</option>.
\r
445 <entry condition="pot">:lock</entry>
\r
447 Locks a file or all files in a directory given in
\r
448 <option>/path</option>.
\r
449 The 'lock' dialog is shown so the
\r
450 user can enter a comment for the lock.
\r
454 <entry condition="pot">:unlock</entry>
\r
456 Unlocks a file or all files in a directory given in
\r
457 <option>/path</option>.
\r
461 <entry condition="pot">:rebuildiconcache</entry>
\r
463 Rebuilds the windows icon cache. Only use this in
\r
464 case the windows icons are corrupted. A side effect
\r
465 of this (which can't be avoided) is that the icons
\r
466 on the desktop get rearranged.
\r
467 To suppress the message box, pass <option>/noquestion</option>.
\r
471 <entry condition="pot">:properties</entry>
\r
473 Shows the properties dialog for the path given in
\r
474 <option>/path</option>.
\r
482 Examples (which should be entered on one line):
\r
484 TortoiseProc.exe /command:commit
\r
485 /path:"c:\svn_wc\file1.txt*c:\svn_wc\file2.txt"
\r
486 /logmsg:"test log message" /closeonend:0
\r
488 TortoiseProc.exe /command:update /path:"c:\svn_wc\" /closeonend:0
\r
490 TortoiseProc.exe /command:log /path:"c:\svn_wc\file1.txt"
\r
491 /startrev:50 /endrev:60 /closeonend:0
\r
496 <sect1 id="tsvn-automation-idiff">
\r
497 <title>TortoiseIDiff Commands</title>
\r
499 <primary>automation</primary>
\r
502 <primary>command line</primary>
\r
505 The image diff tool has a few command line options which you
\r
506 can use to control how the tool is started.
\r
507 The program is called <literal>TortoiseIDiff.exe</literal>.
\r
510 The table below lists all the options which can be passed
\r
511 to the image diff tool on the command line.
\r
514 ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION
\r
515 Don't touch these lines:
\r
516 <entry condition="pot">:about</entry>
\r
518 The condition="pot" prevents the strings from being extracted into
\r
519 the .pot file, so nobody translates them.
\r
520 The colons in front of the command have to stay there to prevent these strings
\r
521 from being translated if the po file "by chance" contains a matching translation.
\r
524 <table id="tsvn-automation-idiff-1-table">
\r
525 <title>List of available options</title>
\r
527 <colspec colnum="1" colwidth="2*"/>
\r
528 <colspec colnum="2" colwidth="6*"/>
\r
531 <entry>Option</entry>
\r
532 <entry>Description</entry>
\r
537 <entry condition="pot">:left</entry>
\r
539 Path to the file shown on the left.
\r
543 <entry condition="pot">:lefttitle</entry>
\r
545 A title string. This string is used in the image view
\r
546 title instead of the full path to the image file.
\r
550 <entry condition="pot">:right</entry>
\r
552 Path to the file shown on the right.
\r
556 <entry condition="pot">:righttitle</entry>
\r
558 A title string. This string is used in the image view
\r
559 title instead of the full path to the image file.
\r
563 <entry condition="pot">:overlay</entry>
\r
565 If specified, the image diff tool switches
\r
566 to the overlay mode (alpha blend).
\r
570 <entry condition="pot">:fit</entry>
\r
572 If specified, the image diff tool fits both
\r
577 <entry condition="pot">:showinfo</entry>
\r
579 Shows the image info box.
\r
587 Example (which should be entered on one line):
\r
589 TortoiseIDiff.exe /left:"c:\images\img1.jpg" /lefttitle:"image 1"
\r
590 /right:"c:\images\img2.jpg" /righttitle:"image 2"
\r