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>TortoiseGitProc.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 TortoiseGitProc.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">:bisect</entry>
\r
139 Allows to control the bisect logic of TortoiseGit.
\r
140 Use the <option>/start</option> parameter to start a bisect you can specify <option>/good:REF</option> and <option>/bad:REF</option> here).
\r
141 When bisect is active, you can use <option>/good</option>, <option>/bad</option> and <option>/reset</option> to control the bisect process.
\r
145 <entry condition="pot">:fetch</entry>
\r
147 Opens the fetch dialog.
\r
148 Use the <option>/remote</option> parameter to control the remote which should be pre-selected.
\r
152 <entry condition="pot">:log</entry>
\r
154 Opens the log dialog. The <option>/path</option> specifies the
\r
155 file or folder for which the log should be shown.
\r
156 Additional options can be set:
\r
157 <option>/rev:"SHA1"</option> highlights and automatically scrolls to the specified revision,
\r
158 <option>/endrev:"SHA1/branch"</option>, shows the log of the specified revision,
\r
159 <option>/startrev:"SHA1/branch"</option> (only in combination with endrev), shows the log of the revision range startrev..endrev,
\r
160 <option>/range:"gitrevision"</option>, shows the log of the entered gitrevision (e.g. "branch1...branch2"),
\r
161 <option>/findstring:"filterstring"</option> fills in the filter text,
\r
162 <option>/findtext</option> forces the filter to use text, not regex, or
\r
163 <option>/findregex</option> forces the filter to use regex, not simple text search, and
\r
164 <option>/findtype:X</option> with X being a number between 0 and 127. The numbers
\r
165 are the sum of the following options:
\r
169 <option>/findtype:0</option> filter by everything
\r
174 <option>/findtype:1</option> filter by messages
\r
179 <option>/findtype:2</option> filter by path
\r
184 <option>/findtype:4</option> filter by authors
\r
189 <option>/findtype:8</option> filter by revisions
\r
194 <option>/findtype:16</option> not used
\r
199 <option>/findtype:32</option> filter by bug ID
\r
204 <option>/findtype:64</option> filter by subject
\r
208 If <option>/outfile:path\to\file</option> is specified,
\r
209 the selected revision is written to that file when
\r
210 the log dialog is closed.
\r
214 <entry condition="pot">:clone</entry>
\r
216 Opens the clone dialog.
\r
221 <entry condition="pot">:import</entry>
\r
223 Opens the import dialog. The <option>/path</option>
\r
224 specifies the directory with the data to import.
\r
230 <entry condition="pot">:update</entry>
\r
232 Updates the working tree in <option>/path</option> to
\r
233 HEAD. If the option <option>/rev</option> is given
\r
234 then a dialog is shown to ask the user to which
\r
235 revision the update should go. To avoid the dialog
\r
236 specify a revision number <option>/rev:1234</option>.
\r
237 Other options are <option>/nonrecursive</option> and
\r
238 <option>/ignoreexternals</option>.
\r
243 <entry condition="pot">:commit</entry>
\r
245 Opens the commit dialog. The <option>/path</option> specifies the
\r
246 target directory or the list of files to commit.
\r
247 You can also specify the <option>/logmsg</option> switch
\r
248 to pass a predefined log message to the commit dialog.
\r
249 Or, if you don't want to pass the log message on the
\r
250 command line, use <option>/logmsgfile:path</option>,
\r
251 where <option>path</option>
\r
252 points to a file containing the log message.
\r
253 To pre-fill the bug ID box (in case you've set up
\r
254 integration with bug trackers properly), you can use
\r
255 the <option>/bugid:"the bug id here"</option> to
\r
260 <entry condition="pot">:add</entry>
\r
262 Adds the files in <option>/path</option> to
\r
267 <entry condition="pot">:revert</entry>
\r
269 Reverts local modifications of a working tree.
\r
270 The <option>/path</option> tells which items
\r
275 <entry condition="pot">:cleanup</entry>
\r
277 Cleans up interrupted or aborted operations and
\r
278 unlocks the working tree in <option>/path</option>.
\r
282 <entry condition="pot">:resolve</entry>
\r
284 Marks a conflicted file specified in
\r
285 <option>/path</option> as resolved. If
\r
286 <option>/noquestion</option> is given, then resolving
\r
287 is done without asking the user first if it really
\r
292 <entry condition="pot">:repocreate</entry>
\r
294 Creates a repository in <option>/path</option>
\r
298 <entry condition="pot">:switch</entry>
\r
300 Opens the switch dialog. The <option>/path</option> specifies the
\r
305 <entry condition="pot">:export</entry>
\r
307 Exports the working tree in <option>/path</option>
\r
308 to another directory. If the <option>/path</option>
\r
309 points to an unversioned directory, a dialog will ask
\r
310 for an URL to export to the directory in <option>/path</option>.
\r
314 <entry condition="pot">:merge</entry>
\r
316 Opens the merge dialog. The <option>/path</option> specifies the
\r
319 For merging a revision range, the following options are available:
\r
320 <option>/fromurl:URL</option>,
\r
321 <option>/revrange:string</option>.
\r
322 For merging two repository trees, the following options are available:
\r
323 <option>/fromurl:URL</option>,
\r
324 <option>/tourl:URL</option>,
\r
325 <option>/fromrev:xxx</option> and
\r
326 <option>/torev:xxx</option>.
\r
327 These pre-fill the relevant fields in the merge dialog.
\r
333 <entry condition="pot">:copy</entry>
\r
335 Brings up the branch/tag dialog.
\r
336 The <option>/path</option>
\r
337 is the working tree to branch/tag from.
\r
338 And the <option>/url</option> is the
\r
340 You can also specify the <option>/logmsg</option> switch
\r
341 to pass a predefined log message to the branch/tag dialog.
\r
342 Or, if you don't want to pass the log message on the
\r
343 command line, use <option>/logmsgfile:path</option>,
\r
344 where <option>path</option>
\r
345 points to a file containing the log message.
\r
350 <entry condition="pot">:settings</entry>
\r
352 Opens the settings dialog.
\r
356 <entry condition="pot">:remove</entry>
\r
358 Removes the file(s) in <option>/path</option> from
\r
363 <entry condition="pot">:rename</entry>
\r
365 Renames the file in <option>/path</option>. The new
\r
366 name for the file is asked with a dialog.
\r
367 To avoid the question about renaming similar files
\r
368 in one step, pass <option>/noquestion</option>.
\r
372 <entry condition="pot">:diff</entry>
\r
374 Starts the external diff program specified in the
\r
375 TortoiseGit settings. The <option>/path</option>
\r
376 specifies the first file.
\r
377 If the option <option>/path2</option>
\r
378 is set, then the diff program is started with those
\r
379 two files. If <option>/path2</option> is omitted,
\r
380 then the diff is done between the file in
\r
381 <option>/path</option> and its BASE.
\r
382 To explicitly set the revision numbers use
\r
383 <option>/startrev:xxx</option> and
\r
384 <option>/endrev:xxx</option>.
\r
385 If <option>/blame</option> is set and <option>/path2</option>
\r
386 is not set, then the diff is done by first blaming
\r
387 the files with the given revisions.
\r
391 <entry condition="pot">:showcompare</entry>
\r
394 Depending on revisions to compare and the path, this
\r
395 either shows a unified diff (if the option <option>unified</option> is set),
\r
396 a dialog with a list of files that have changed (filtered by a possibly entered subpath) or if
\r
397 the path point to a file starts the diff viewer for
\r
398 those the file in the different revisions.
\r
403 <entry condition="pot">:conflicteditor</entry>
\r
405 Starts the conflict editor specified in the TortoiseGit
\r
406 settings with the correct files for the conflicted
\r
407 file in <option>/path</option>.
\r
412 <entry condition="pot">:relocate</entry>
\r
414 Opens the relocate dialog. The <option>/path</option>
\r
415 specifies the working tree path to relocate.
\r
420 <entry condition="pot">:help</entry>
\r
422 Opens the help file.
\r
426 <entry condition="pot">:repostatus</entry>
\r
428 Opens the check-for-modifications dialog. The <option>/path</option>
\r
429 specifies the working tree directory.
\r
433 <entry condition="pot">:repobrowser</entry>
\r
435 Starts the repository browser dialog, pointing to
\r
436 the working tree given in <option>/path</option>.
\r
437 An additional option <option>/rev:xxx</option> can
\r
438 be used to specify the revision which the repository
\r
439 browser should show. If the <option>/rev:xxx</option>
\r
440 is omitted, it defaults to HEAD.
\r
444 <entry condition="pot">:ignore</entry>
\r
446 Adds all targets in <option>/path</option> to the
\r
447 ignore list, i.e. adds the <literal>svn:ignore</literal>
\r
448 property to those files.
\r
452 <entry condition="pot">:blame</entry>
\r
455 Opens the blame dialog for the file specified
\r
456 in <option>/path</option>.
\r
459 If the option <option>/endrev</option> is set TortoiseGitBlame
\r
460 ends at that revision.
\r
463 If the option <option>/line:nnn</option> is set,
\r
464 TortoiseGitBlame 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
558 <entry condition="pot">:updatecheck</entry>
\r
560 <option>/visible</option>: Shows the dialog even if no newer TortoiseGit version is available.
\r
561 <option>/force</option>: Shows file list for download even if the latest TortoiseGit has been installed.
\r
566 <entry condition="pot">:revisiongraph</entry>
\r
568 Shows the revision graph for the path given in
\r
569 <option>/path</option>.
\r
575 <entry condition="pot">:rebuildiconcache</entry>
\r
577 Rebuilds the windows icon cache. Only use this in
\r
578 case the windows icons are corrupted. A side effect
\r
579 of this (which can't be avoided) is that the icons
\r
580 on the desktop get rearranged.
\r
581 To suppress the message box, pass <option>/noquestion</option>.
\r
590 Examples (which should be entered on one line):
\r
592 TortoiseGitProc.exe /command:commit
\r
593 /path:"c:\svn_wc\file1.txt*c:\svn_wc\file2.txt"
\r
594 /logmsg:"test log message" /closeonend:0
\r
596 TortoiseGitProc.exe /command:update /path:"c:\svn_wc\" /closeonend:0
\r
598 TortoiseGitProc.exe /command:log /path:"c:\svn_wc\file1.txt"
\r
599 /startrev:50 /endrev:60 /closeonend:0
\r
604 <sect1 id="tsvn-automation-idiff">
\r
605 <title>TortoiseIDiff Commands</title>
\r
607 <primary>automation</primary>
\r
610 <primary>command line</primary>
\r
613 The image diff tool has a few command line options which you
\r
614 can use to control how the tool is started.
\r
615 The program is called <literal>TortoiseGitIDiff.exe</literal>.
\r
618 The table below lists all the options which can be passed
\r
619 to the image diff tool on the command line.
\r
622 ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION
\r
623 Don't touch these lines:
\r
624 <entry condition="pot">:about</entry>
\r
626 The condition="pot" prevents the strings from being extracted into
\r
627 the .pot file, so nobody translates them.
\r
628 The colons in front of the command have to stay there to prevent these strings
\r
629 from being translated if the po file "by chance" contains a matching translation.
\r
632 <table id="tsvn-automation-idiff-1-table">
\r
633 <title>List of available options</title>
\r
635 <colspec colnum="1" colwidth="2*"/>
\r
636 <colspec colnum="2" colwidth="6*"/>
\r
639 <entry>Option</entry>
\r
640 <entry>Description</entry>
\r
645 <entry condition="pot">:left</entry>
\r
647 Path to the file shown on the left.
\r
651 <entry condition="pot">:lefttitle</entry>
\r
653 A title string. This string is used in the image view
\r
654 title instead of the full path to the image file.
\r
658 <entry condition="pot">:right</entry>
\r
660 Path to the file shown on the right.
\r
664 <entry condition="pot">:righttitle</entry>
\r
666 A title string. This string is used in the image view
\r
667 title instead of the full path to the image file.
\r
671 <entry condition="pot">:overlay</entry>
\r
673 If specified, the image diff tool switches
\r
674 to the overlay mode (alpha blend).
\r
678 <entry condition="pot">:fit</entry>
\r
680 If specified, the image diff tool fits both
\r
685 <entry condition="pot">:showinfo</entry>
\r
687 Shows the image info box.
\r
695 Example (which should be entered on one line):
\r
697 TortoiseGitIDiff.exe /left:"c:\images\img1.jpg" /lefttitle:"image 1"
\r
698 /right:"c:\images\img2.jpg" /righttitle:"image 2"
\r