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
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>
\r
145 <entry condition="pot">:checkout</entry>
\r
147 Opens the checkout dialog. The <option>/path</option>
\r
148 specifies the working directory and the <option>/rev</option>
\r
149 specifies the commit 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
163 <entry condition="pot">:update</entry>
\r
165 Updates the working copy in <option>/path</option> to
\r
166 HEAD. If the option <option>/rev</option> is given
\r
167 then a dialog is shown to ask the user to which
\r
168 revision the update should go. To avoid the dialog
\r
169 specify a revision number <option>/rev:1234</option>.
\r
170 Other options are <option>/nonrecursive</option> and
\r
171 <option>/ignoreexternals</option>.
\r
176 <entry condition="pot">:commit</entry>
\r
178 Opens the commit dialog. The <option>/path</option> specifies the
\r
179 target directory or the list of files to commit.
\r
180 You can also specify the <option>/logmsg</option> switch
\r
181 to pass a predefined log message to the commit dialog.
\r
182 Or, if you don't want to pass the log message on the
\r
183 command line, use <option>/logmsgfile:path</option>,
\r
184 where <option>path</option>
\r
185 points to a file containing the log message.
\r
186 To pre-fill the bug ID box (in case you've set up
\r
187 integration with bug trackers properly), you can use
\r
188 the <option>/bugid:"the bug id here"</option> to
\r
193 <entry condition="pot">:add</entry>
\r
195 Adds the files in <option>/path</option> to
\r
200 <entry condition="pot">:revert</entry>
\r
202 Reverts local modifications of a working copy.
\r
203 The <option>/path</option> tells which items
\r
208 <entry condition="pot">:cleanup</entry>
\r
210 Cleans up interrupted or aborted operations and
\r
211 unlocks the working copy in <option>/path</option>.
\r
215 <entry condition="pot">:resolve</entry>
\r
217 Marks a conflicted file specified in
\r
218 <option>/path</option> as resolved. If
\r
219 <option>/noquestion</option> is given, then resolving
\r
220 is done without asking the user first if it really
\r
226 <entry condition="pot">:repocreate</entry>
\r
228 Creates a repository in <option>/path</option>
\r
233 <entry condition="pot">:switch</entry>
\r
235 Opens the switch dialog. The <option>/path</option> specifies the
\r
240 <entry condition="pot">:export</entry>
\r
242 Exports the working copy in <option>/path</option>
\r
243 to another directory. If the <option>/path</option>
\r
244 points to an unversioned directory, a dialog will ask
\r
245 for an URL to export to the directory in <option>/path</option>.
\r
249 <entry condition="pot">:merge</entry>
\r
251 Opens the merge dialog. The <option>/path</option> specifies the
\r
253 For merging a revision range, the following options are available:
\r
254 <option>/fromurl:URL</option>,
\r
255 <option>/revrange:string</option>.
\r
256 For merging two repository trees, the following options are available:
\r
257 <option>/fromurl:URL</option>,
\r
258 <option>/tourl:URL</option>,
\r
259 <option>/fromrev:xxx</option> and
\r
260 <option>/torev:xxx</option>.
\r
261 These pre-fill the relevant fields in the merge dialog.
\r
266 <entry condition="pot">:mergeall</entry>
\r
268 Opens the merge all dialog. The <option>/path</option> specifies the
\r
275 <entry condition="pot">:copy</entry>
\r
277 Brings up the branch/tag dialog.
\r
278 The <option>/path</option>
\r
279 is the working copy to branch/tag from.
\r
280 And the <option>/url</option> is the
\r
282 You can also specify the <option>/logmsg</option> switch
\r
283 to pass a predefined log message to the branch/tag dialog.
\r
284 Or, if you don't want to pass the log message on the
\r
285 command line, use <option>/logmsgfile:path</option>,
\r
286 where <option>path</option>
\r
287 points to a file containing the log message.
\r
292 <entry condition="pot">:settings</entry>
\r
294 Opens the settings dialog.
\r
298 <entry condition="pot">:remove</entry>
\r
300 Removes the file(s) in <option>/path</option> from
\r
305 <entry condition="pot">:rename</entry>
\r
307 Renames the file in <option>/path</option>. The new
\r
308 name for the file is asked with a dialog.
\r
309 To avoid the question about renaming similar files
\r
310 in one step, pass <option>/noquestion</option>.
\r
314 <entry condition="pot">:diff</entry>
\r
316 Starts the external diff program specified in the
\r
317 TortoiseGit settings. The <option>/path</option>
\r
318 specifies the first file.
\r
319 If the option <option>/path2</option>
\r
320 is set, then the diff program is started with those
\r
321 two files. If <option>/path2</option> is omitted,
\r
322 then the diff is done between the file in
\r
323 <option>/path</option> and its BASE.
\r
324 To explicitly set the revision numbers use
\r
325 <option>/startrev:xxx</option> and
\r
326 <option>/endrev:xxx</option>.
\r
327 If <option>/blame</option> is set and <option>/path2</option>
\r
328 is not set, then the diff is done by first blaming
\r
329 the files with the given revisions.
\r
334 <entry condition="pot">:showcompare</entry>
\r
337 Depending on the URLs and revisions to compare, this
\r
338 either shows a unified diff (if the option <option>unified</option> is set),
\r
339 a dialog with a list of files that have changed or if
\r
340 the URLs point to files starts the diff viewer for
\r
344 The options <option>url1</option>, <option>url2</option>,
\r
345 <option>revision1</option> and <option>revision2</option>
\r
346 must be specified. The options <option>pegrevision</option>,
\r
347 <option>ignoreancestry</option>, <option>blame</option> and
\r
348 <option>unified</option> are optional.
\r
354 <entry condition="pot">:conflicteditor</entry>
\r
356 Starts the conflict editor specified in the TortoiseGit
\r
357 settings with the correct files for the conflicted
\r
358 file in <option>/path</option>.
\r
363 <entry condition="pot">:relocate</entry>
\r
365 Opens the relocate dialog. The <option>/path</option>
\r
366 specifies the working copy path to relocate.
\r
371 <entry condition="pot">:help</entry>
\r
373 Opens the help file.
\r
378 <entry condition="pot">:repostatus</entry>
\r
380 Opens the check-for-modifications dialog. The <option>/path</option>
\r
381 specifies the working copy directory.
\r
387 <entry condition="pot">:repobrowser</entry>
\r
389 Starts the repository browser dialog, pointing to
\r
390 the URL of the working copy given in
\r
391 <option>/path</option> or <option>/path</option>
\r
392 points directly to an URL.
\r
393 An additional option <option>/rev:xxx</option> can
\r
394 be used to specify the revision which the repository
\r
395 browser should show. If the <option>/rev:xxx</option>
\r
396 is omitted, it defaults to HEAD.
\r
397 If <option>/path</option> points to an URL, the
\r
398 <option>/projectpropertiespath:path/to/wc</option> specifies
\r
399 the path from where to read and use the project properties.
\r
404 <entry condition="pot">:ignore</entry>
\r
406 Adds all targets in <option>/path</option> to the
\r
407 ignore list, i.e. adds the <literal>svn:ignore</literal>
\r
408 property to those files.
\r
412 <entry condition="pot">:blame</entry>
\r
415 Opens the blame dialog for the file specified
\r
416 in <option>/path</option>.
\r
419 If the options <option>/startrev</option> and
\r
420 <option>/endrev</option> are set, then the dialog
\r
421 asking for the blame range is not shown but
\r
422 the revision values of those options are used
\r
426 If the option <option>/line:nnn</option> is set,
\r
427 TortoiseBlame will open with the specified line
\r
431 The options <option>/ignoreeol</option>,
\r
432 <option>/ignorespaces</option> and
\r
433 <option>/ignoreallspaces</option> are also supported.
\r
438 <entry condition="pot">:cat</entry>
\r
440 Saves a file from an URL or working copy path given
\r
441 in <option>/path</option> to the location given in
\r
442 <option>/savepath:path</option>. The revision is
\r
443 given in <option>/revision:xxx</option>. This can
\r
444 be used to get a file with a specific revision.
\r
448 <entry condition="pot">:createpatch</entry>
\r
450 Creates a patch file for the path given in
\r
451 <option>/path</option>.
\r
456 <entry condition="pot">:revisiongraph</entry>
\r
458 Shows the revision graph for the path given in
\r
459 <option>/path</option>.
\r
465 <entry condition="pot">:lock</entry>
\r
467 Locks a file or all files in a directory given in
\r
468 <option>/path</option>.
\r
469 The 'lock' dialog is shown so the
\r
470 user can enter a comment for the lock.
\r
476 <entry condition="pot">:unlock</entry>
\r
478 Unlocks a file or all files in a directory given in
\r
479 <option>/path</option>.
\r
485 <entry condition="pot">:rebuildiconcache</entry>
\r
487 Rebuilds the windows icon cache. Only use this in
\r
488 case the windows icons are corrupted. A side effect
\r
489 of this (which can't be avoided) is that the icons
\r
490 on the desktop get rearranged.
\r
491 To suppress the message box, pass <option>/noquestion</option>.
\r
495 <entry condition="pot">:properties</entry>
\r
497 Shows the properties dialog for the path given in
\r
498 <option>/path</option>.
\r
507 Examples (which should be entered on one line):
\r
509 TortoiseProc.exe /command:commit
\r
510 /path:"c:\svn_wc\file1.txt*c:\svn_wc\file2.txt"
\r
511 /logmsg:"test log message" /closeonend:0
\r
513 TortoiseProc.exe /command:update /path:"c:\svn_wc\" /closeonend:0
\r
515 TortoiseProc.exe /command:log /path:"c:\svn_wc\file1.txt"
\r
516 /startrev:50 /endrev:60 /closeonend:0
\r
521 <sect1 id="tsvn-automation-idiff">
\r
522 <title>TortoiseIDiff Commands</title>
\r
524 <primary>automation</primary>
\r
527 <primary>command line</primary>
\r
530 The image diff tool has a few command line options which you
\r
531 can use to control how the tool is started.
\r
532 The program is called <literal>TortoiseIDiff.exe</literal>.
\r
535 The table below lists all the options which can be passed
\r
536 to the image diff tool on the command line.
\r
539 ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION
\r
540 Don't touch these lines:
\r
541 <entry condition="pot">:about</entry>
\r
543 The condition="pot" prevents the strings from being extracted into
\r
544 the .pot file, so nobody translates them.
\r
545 The colons in front of the command have to stay there to prevent these strings
\r
546 from being translated if the po file "by chance" contains a matching translation.
\r
549 <table id="tsvn-automation-idiff-1-table">
\r
550 <title>List of available options</title>
\r
552 <colspec colnum="1" colwidth="2*"/>
\r
553 <colspec colnum="2" colwidth="6*"/>
\r
556 <entry>Option</entry>
\r
557 <entry>Description</entry>
\r
562 <entry condition="pot">:left</entry>
\r
564 Path to the file shown on the left.
\r
568 <entry condition="pot">:lefttitle</entry>
\r
570 A title string. This string is used in the image view
\r
571 title instead of the full path to the image file.
\r
575 <entry condition="pot">:right</entry>
\r
577 Path to the file shown on the right.
\r
581 <entry condition="pot">:righttitle</entry>
\r
583 A title string. This string is used in the image view
\r
584 title instead of the full path to the image file.
\r
588 <entry condition="pot">:overlay</entry>
\r
590 If specified, the image diff tool switches
\r
591 to the overlay mode (alpha blend).
\r
595 <entry condition="pot">:fit</entry>
\r
597 If specified, the image diff tool fits both
\r
602 <entry condition="pot">:showinfo</entry>
\r
604 Shows the image info box.
\r
612 Example (which should be entered on one line):
\r
614 TortoiseIDiff.exe /left:"c:\images\img1.jpg" /lefttitle:"image 1"
\r
615 /right:"c:\images\img2.jpg" /righttitle:"image 2"
\r