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 Git 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
66 To close the progress dialog at the end of a command automatically without
\r
67 using the permanent setting you can pass the <option>/closeonend</option>
\r
72 <option>/closeonend:0</option> don't close the dialog automatically
\r
77 <option>/closeonend:1</option> auto close if no errors
\r
82 <option>/closeonend:2</option> auto close if no errors and conflicts
\r
87 <option>/closeonend:3</option> auto close if no errors, conflicts and merges
\r
92 <option>/closeonend:4</option> auto close if no errors, conflicts and merges
\r
93 for local operations
\r
100 The table below lists all the commands which can be accessed
\r
101 using the TortoiseProc.exe command line. As described above,
\r
102 these should be used in the form <literal>/command:abcd</literal>.
\r
103 In the table, the <literal>/command</literal> prefix is omitted
\r
107 ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION
\r
108 Don't touch these lines:
\r
109 <entry condition="pot">:about</entry>
\r
111 The condition="pot" prevents the strings from being extracted into
\r
112 the .pot file, so nobody translates them.
\r
113 The colons in front of the command have to stay there to prevent these strings
\r
114 from being translated if the po file "by chance" contains a matching translation.
\r
117 <table id="tsvn-automation-1-table">
\r
118 <title>List of available commands and options</title>
\r
120 <colspec colnum="1" colwidth="2*"/>
\r
121 <colspec colnum="2" colwidth="6*"/>
\r
124 <entry>Command</entry>
\r
125 <entry>Description</entry>
\r
130 <entry condition="pot">:about</entry>
\r
132 Shows the about dialog. This is also shown if no
\r
137 <entry condition="pot">:log</entry>
\r
139 Opens the log dialog. The <option>/path</option> specifies the
\r
140 file or folder for which the log should be shown.
\r
141 Additional options can be set:
\r
142 <option>/rev:"SHA1"</option> highlights and automatically scrolls to the specified revision,
\r
143 <option>/findstring:"filterstring"</option> fills in the filter text,
\r
144 <option>/findtext</option> forces the filter to use text, not regex, or
\r
145 <option>/findregex</option> forces the filter to use regex, not simple text search, and
\r
146 <option>/findtype:X</option> with X being a number between 0 and 127. The numbers
\r
147 are the sum of the following options:
\r
151 <option>/findtype:0</option> filter by everything
\r
156 <option>/findtype:1</option> filter by messages
\r
161 <option>/findtype:2</option> filter by path
\r
166 <option>/findtype:4</option> filter by authors
\r
171 <option>/findtype:8</option> filter by revisions
\r
176 <option>/findtype:16</option> not used
\r
181 <option>/findtype:32</option> filter by bug ID
\r
186 <option>/findtype:64</option> filter by subject
\r
190 If <option>/outfile:path\to\file</option> is specified,
\r
191 the selected revision is written to that file when
\r
192 the log dialog is closed.
\r
196 <entry condition="pot">:clone</entry>
\r
198 Opens the clone dialog.
\r
203 <entry condition="pot">:import</entry>
\r
205 Opens the import dialog. The <option>/path</option>
\r
206 specifies the directory with the data to import.
\r
212 <entry condition="pot">:update</entry>
\r
214 Updates the working tree in <option>/path</option> to
\r
215 HEAD. If the option <option>/rev</option> is given
\r
216 then a dialog is shown to ask the user to which
\r
217 revision the update should go. To avoid the dialog
\r
218 specify a revision number <option>/rev:1234</option>.
\r
219 Other options are <option>/nonrecursive</option> and
\r
220 <option>/ignoreexternals</option>.
\r
225 <entry condition="pot">:commit</entry>
\r
227 Opens the commit dialog. The <option>/path</option> specifies the
\r
228 target directory or the list of files to commit.
\r
229 You can also specify the <option>/logmsg</option> switch
\r
230 to pass a predefined log message to the commit dialog.
\r
231 Or, if you don't want to pass the log message on the
\r
232 command line, use <option>/logmsgfile:path</option>,
\r
233 where <option>path</option>
\r
234 points to a file containing the log message.
\r
235 To pre-fill the bug ID box (in case you've set up
\r
236 integration with bug trackers properly), you can use
\r
237 the <option>/bugid:"the bug id here"</option> to
\r
242 <entry condition="pot">:add</entry>
\r
244 Adds the files in <option>/path</option> to
\r
249 <entry condition="pot">:revert</entry>
\r
251 Reverts local modifications of a working tree.
\r
252 The <option>/path</option> tells which items
\r
257 <entry condition="pot">:cleanup</entry>
\r
259 Cleans up interrupted or aborted operations and
\r
260 unlocks the working tree in <option>/path</option>.
\r
264 <entry condition="pot">:resolve</entry>
\r
266 Marks a conflicted file specified in
\r
267 <option>/path</option> as resolved. If
\r
268 <option>/noquestion</option> is given, then resolving
\r
269 is done without asking the user first if it really
\r
274 <entry condition="pot">:repocreate</entry>
\r
276 Creates a repository in <option>/path</option>
\r
280 <entry condition="pot">:switch</entry>
\r
282 Opens the switch dialog. The <option>/path</option> specifies the
\r
287 <entry condition="pot">:export</entry>
\r
289 Exports the working tree in <option>/path</option>
\r
290 to another directory. If the <option>/path</option>
\r
291 points to an unversioned directory, a dialog will ask
\r
292 for an URL to export to the directory in <option>/path</option>.
\r
296 <entry condition="pot">:merge</entry>
\r
298 Opens the merge dialog. The <option>/path</option> specifies the
\r
301 For merging a revision range, the following options are available:
\r
302 <option>/fromurl:URL</option>,
\r
303 <option>/revrange:string</option>.
\r
304 For merging two repository trees, the following options are available:
\r
305 <option>/fromurl:URL</option>,
\r
306 <option>/tourl:URL</option>,
\r
307 <option>/fromrev:xxx</option> and
\r
308 <option>/torev:xxx</option>.
\r
309 These pre-fill the relevant fields in the merge dialog.
\r
315 <entry condition="pot">:copy</entry>
\r
317 Brings up the branch/tag dialog.
\r
318 The <option>/path</option>
\r
319 is the working tree to branch/tag from.
\r
320 And the <option>/url</option> is the
\r
322 You can also specify the <option>/logmsg</option> switch
\r
323 to pass a predefined log message to the branch/tag dialog.
\r
324 Or, if you don't want to pass the log message on the
\r
325 command line, use <option>/logmsgfile:path</option>,
\r
326 where <option>path</option>
\r
327 points to a file containing the log message.
\r
332 <entry condition="pot">:settings</entry>
\r
334 Opens the settings dialog.
\r
338 <entry condition="pot">:remove</entry>
\r
340 Removes the file(s) in <option>/path</option> from
\r
345 <entry condition="pot">:rename</entry>
\r
347 Renames the file in <option>/path</option>. The new
\r
348 name for the file is asked with a dialog.
\r
349 To avoid the question about renaming similar files
\r
350 in one step, pass <option>/noquestion</option>.
\r
354 <entry condition="pot">:diff</entry>
\r
356 Starts the external diff program specified in the
\r
357 TortoiseGit settings. The <option>/path</option>
\r
358 specifies the first file.
\r
359 If the option <option>/path2</option>
\r
360 is set, then the diff program is started with those
\r
361 two files. If <option>/path2</option> is omitted,
\r
362 then the diff is done between the file in
\r
363 <option>/path</option> and its BASE.
\r
364 To explicitly set the revision numbers use
\r
365 <option>/startrev:xxx</option> and
\r
366 <option>/endrev:xxx</option>.
\r
367 If <option>/blame</option> is set and <option>/path2</option>
\r
368 is not set, then the diff is done by first blaming
\r
369 the files with the given revisions.
\r
374 <entry condition="pot">:showcompare</entry>
\r
377 Depending on the URLs and revisions to compare, this
\r
378 either shows a unified diff (if the option <option>unified</option> is set),
\r
379 a dialog with a list of files that have changed or if
\r
380 the URLs point to files starts the diff viewer for
\r
384 The options <option>url1</option>, <option>url2</option>,
\r
385 <option>revision1</option> and <option>revision2</option>
\r
386 must be specified. The options <option>pegrevision</option>,
\r
387 <option>ignoreancestry</option>, <option>blame</option> and
\r
388 <option>unified</option> are optional.
\r
394 <entry condition="pot">:conflicteditor</entry>
\r
396 Starts the conflict editor specified in the TortoiseGit
\r
397 settings with the correct files for the conflicted
\r
398 file in <option>/path</option>.
\r
403 <entry condition="pot">:relocate</entry>
\r
405 Opens the relocate dialog. The <option>/path</option>
\r
406 specifies the working tree path to relocate.
\r
411 <entry condition="pot">:help</entry>
\r
413 Opens the help file.
\r
417 <entry condition="pot">:repostatus</entry>
\r
419 Opens the check-for-modifications dialog. The <option>/path</option>
\r
420 specifies the working tree directory.
\r
425 <entry condition="pot">:repobrowser</entry>
\r
427 Starts the repository browser dialog, pointing to
\r
428 the URL of the working tree given in
\r
429 <option>/path</option> or <option>/path</option>
\r
430 points directly to an URL.
\r
431 An additional option <option>/rev:xxx</option> can
\r
432 be used to specify the revision which the repository
\r
433 browser should show. If the <option>/rev:xxx</option>
\r
434 is omitted, it defaults to HEAD.
\r
435 If <option>/path</option> points to an URL, the
\r
436 <option>/projectpropertiespath:path/to/wc</option> specifies
\r
437 the path from where to read and use the project properties.
\r
442 <entry condition="pot">:ignore</entry>
\r
444 Adds all targets in <option>/path</option> to the
\r
445 ignore list, i.e. adds the <literal>svn:ignore</literal>
\r
446 property to those files.
\r
450 <entry condition="pot">:blame</entry>
\r
453 Opens the blame dialog for the file specified
\r
454 in <option>/path</option>.
\r
457 If the option <option>/endrev</option> is set TortoiseGitBlame
\r
458 ends at that revision.
\r
462 If the option <option>/line:nnn</option> is set,
\r
463 TortoiseBlame will open with the specified line
\r
470 <entry condition="pot">:cat</entry>
\r
472 Saves a file from an URL or working tree path given
\r
473 in <option>/path</option> to the location given in
\r
474 <option>/savepath:path</option>. The revision is
\r
475 given in <option>/revision:xxx</option>. This can
\r
476 be used to get a file with a specific revision.
\r
481 <entry condition="pot">:createpatch</entry>
\r
483 Creates a patch file for the path given in
\r
484 <option>/path</option>.
\r
489 <entry condition="pot">:pull</entry>
\r
491 Pull change from remote repository
\r
492 <option>/path</option>.
\r
496 <entry condition="pot">:push</entry>
\r
498 Push change to remote repository
\r
499 <option>/path</option>.
\r
503 <entry condition="pot">:rebase</entry>
\r
505 Rebase commits to special commit.
\r
506 <option>/path</option>.
\r
510 <entry condition="pot">:stashsave</entry>
\r
512 <option>/path</option>.
\r
516 <entry condition="pot">:stashapply</entry>
\r
518 <option>/path</option>.
\r
522 <entry condition="pot">:stashpop</entry>
\r
524 <option>/path</option>.
\r
528 <entry condition="pot">:subadd</entry>
\r
530 <option>/path</option>.
\r
534 <entry condition="pot">:subupdate</entry>
\r
536 <option>/path</option>.
\r
540 <entry condition="pot">:subsync</entry>
\r
542 <option>/path</option>.
\r
546 <entry condition="pot">:reflog</entry>
\r
548 <option>/path</option>.
\r
552 <entry condition="pot">:refbrowse</entry>
\r
554 <option>/path</option>.
\r
559 <entry condition="pot">:revisiongraph</entry>
\r
561 Shows the revision graph for the path given in
\r
562 <option>/path</option>.
\r
568 <entry condition="pot">:rebuildiconcache</entry>
\r
570 Rebuilds the windows icon cache. Only use this in
\r
571 case the windows icons are corrupted. A side effect
\r
572 of this (which can't be avoided) is that the icons
\r
573 on the desktop get rearranged.
\r
574 To suppress the message box, pass <option>/noquestion</option>.
\r
583 Examples (which should be entered on one line):
\r
585 TortoiseProc.exe /command:commit
\r
586 /path:"c:\svn_wc\file1.txt*c:\svn_wc\file2.txt"
\r
587 /logmsg:"test log message" /closeonend:0
\r
589 TortoiseProc.exe /command:update /path:"c:\svn_wc\" /closeonend:0
\r
591 TortoiseProc.exe /command:log /path:"c:\svn_wc\file1.txt"
\r
592 /startrev:50 /endrev:60 /closeonend:0
\r
597 <sect1 id="tsvn-automation-idiff">
\r
598 <title>TortoiseIDiff Commands</title>
\r
600 <primary>automation</primary>
\r
603 <primary>command line</primary>
\r
606 The image diff tool has a few command line options which you
\r
607 can use to control how the tool is started.
\r
608 The program is called <literal>TortoiseIDiff.exe</literal>.
\r
611 The table below lists all the options which can be passed
\r
612 to the image diff tool on the command line.
\r
615 ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION
\r
616 Don't touch these lines:
\r
617 <entry condition="pot">:about</entry>
\r
619 The condition="pot" prevents the strings from being extracted into
\r
620 the .pot file, so nobody translates them.
\r
621 The colons in front of the command have to stay there to prevent these strings
\r
622 from being translated if the po file "by chance" contains a matching translation.
\r
625 <table id="tsvn-automation-idiff-1-table">
\r
626 <title>List of available options</title>
\r
628 <colspec colnum="1" colwidth="2*"/>
\r
629 <colspec colnum="2" colwidth="6*"/>
\r
632 <entry>Option</entry>
\r
633 <entry>Description</entry>
\r
638 <entry condition="pot">:left</entry>
\r
640 Path to the file shown on the left.
\r
644 <entry condition="pot">:lefttitle</entry>
\r
646 A title string. This string is used in the image view
\r
647 title instead of the full path to the image file.
\r
651 <entry condition="pot">:right</entry>
\r
653 Path to the file shown on the right.
\r
657 <entry condition="pot">:righttitle</entry>
\r
659 A title string. This string is used in the image view
\r
660 title instead of the full path to the image file.
\r
664 <entry condition="pot">:overlay</entry>
\r
666 If specified, the image diff tool switches
\r
667 to the overlay mode (alpha blend).
\r
671 <entry condition="pot">:fit</entry>
\r
673 If specified, the image diff tool fits both
\r
678 <entry condition="pot">:showinfo</entry>
\r
680 Shows the image info box.
\r
688 Example (which should be entered on one line):
\r
690 TortoiseIDiff.exe /left:"c:\images\img1.jpg" /lefttitle:"image 1"
\r
691 /right:"c:\images\img2.jpg" /righttitle:"image 2"
\r