1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE appendix SYSTEM "../../dtd/dblite.dtd">
\r
3 <appendix id="tgit-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="tgit-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 git.exe 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 in the settings dialog.
\r
55 You may use <option>/closeonend</option> parameter to override the this setting
\r
56 from your batch file.
\r
59 To specify a different location of the configuration file, use the parameter
\r
60 <option>/configdir:"path\to\config\directory"</option>.
\r
61 This will override the default path, including any registry setting.
\r
64 To close the (git.exe) progress dialog at the end of a command automatically without
\r
65 using the permanent setting you can pass the <option>/closeonend</option>
\r
70 <option>/closeonend:0</option> Close manually
\r
75 <option>/closeonend:1</option> Auto-close if no further options are available
\r
80 <option>/closeonend:2</option> Auto-close if no errors
\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
99 The table below lists all the commands which can be accessed
\r
100 using the TortoiseGitProc.exe command line. As described above,
\r
101 these should be used in the form <literal>/command:abcd</literal>.
\r
102 In the table, the <literal>/command</literal> prefix is omitted
\r
106 ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION
\r
107 Don't touch these lines:
\r
108 <entry condition="pot">:about</entry>
\r
110 The condition="pot" prevents the strings from being extracted into
\r
111 the .pot file, so nobody translates them.
\r
112 The colons in front of the command have to stay there to prevent these strings
\r
113 from being translated if the po file "by chance" contains a matching translation.
\r
116 <table id="tgit-automation-1-table">
\r
117 <title>List of available commands and options</title>
\r
119 <colspec colnum="1" colwidth="2*"/>
\r
120 <colspec colnum="2" colwidth="6*"/>
\r
123 <entry>Command</entry>
\r
124 <entry>Description</entry>
\r
129 <entry condition="pot">:about</entry>
\r
131 Shows the about dialog. This is also shown if no
\r
136 <entry condition="pot">:bisect</entry>
\r
138 Allows to control the bisect logic of TortoiseGit.
\r
139 Use the <option>/start</option> parameter to start a bisect you can specify <option>/good:REF</option> and <option>/bad:REF</option> here).
\r
140 When bisect is active, you can use <option>/good</option>, <option>/bad</option> and <option>/reset</option> to control the bisect process.
\r
144 <entry condition="pot">:fetch</entry>
\r
146 Opens the fetch dialog.
\r
147 Use the <option>/remote</option> parameter to control the remote which should be pre-selected.
\r
151 <entry condition="pot">:log</entry>
\r
153 Opens the log dialog. The <option>/path</option> specifies the
\r
154 file or folder for which the log should be shown.
\r
155 Additional options can be set:
\r
156 <option>/rev:"SHA1"</option> highlights and automatically scrolls to the specified revision,
\r
157 <option>/endrev:"SHA1/branch"</option>, shows the log of the specified revision,
\r
158 <option>/startrev:"SHA1/branch"</option> (only in combination with endrev), shows the log of the revision range startrev..endrev,
\r
159 <option>/range:"gitrevision"</option>, shows the log of the entered gitrevision (e.g. "branch1...branch2"),
\r
160 <option>/findstring:"filterstring"</option> fills in the filter text,
\r
161 <option>/findtext</option> forces the filter to use text, not regex, or
\r
162 <option>/findregex</option> forces the filter to use regex, not simple text search, and
\r
163 <option>/findtype:X</option> with X being a number between 0 and 127. The numbers
\r
164 are the sum of the following options:
\r
168 <option>/findtype:0</option> filter by everything
\r
173 <option>/findtype:1</option> filter by messages
\r
178 <option>/findtype:2</option> filter by path
\r
183 <option>/findtype:4</option> filter by authors
\r
188 <option>/findtype:8</option> filter by revisions
\r
193 <option>/findtype:16</option> not used
\r
198 <option>/findtype:32</option> filter by bug ID
\r
203 <option>/findtype:64</option> filter by subject
\r
207 If <option>/outfile:path\to\file</option> is specified,
\r
208 the selected revision is written to that file when
\r
209 the log dialog is closed.
\r
213 <entry condition="pot">:clone</entry>
\r
215 Opens the clone dialog.
\r
216 The <option>/url</option> specifies the URL to clone from.
\r
217 The <option>/path</option> specifies the target directory
\r
219 If <option>/exactpath</option> is not specfied, the
\r
220 repository name (without trailing .git) will be appended to
\r
221 target directory. This is the default behaviour.
\r
222 If <option>/exactpath</option> is specfied, the
\r
223 exact <option>/path</option> is considered the target directory,
\r
224 without appending repository name to it.
\r
229 <entry condition="pot">:import</entry>
\r
231 Opens the import dialog. The <option>/path</option>
\r
232 specifies the directory with the data to import.
\r
238 <entry condition="pot">:update</entry>
\r
240 Updates the working tree in <option>/path</option> to
\r
241 HEAD. If the option <option>/rev</option> is given
\r
242 then a dialog is shown to ask the user to which
\r
243 revision the update should go. To avoid the dialog
\r
244 specify a revision number <option>/rev:1234</option>.
\r
245 Other options are <option>/nonrecursive</option> and
\r
246 <option>/ignoreexternals</option>.
\r
251 <entry condition="pot">:commit</entry>
\r
253 Opens the commit dialog. The <option>/path</option> specifies the
\r
254 target directory or the list of files to commit.
\r
255 You can also specify the <option>/logmsg</option> switch
\r
256 to pass a predefined log message to the commit dialog.
\r
257 Or, if you don't want to pass the log message on the
\r
258 command line, use <option>/logmsgfile:path</option>,
\r
259 where <option>path</option>
\r
260 points to a file containing the log message.
\r
261 To pre-fill the bug ID box (in case you've set up
\r
262 integration with bug trackers properly), you can use
\r
263 the <option>/bugid:"the bug id here"</option> to
\r
268 <entry condition="pot">:add</entry>
\r
270 Adds the files in <option>/path</option> to
\r
275 <entry condition="pot">:revert</entry>
\r
277 Reverts local modifications of a working tree.
\r
278 The <option>/path</option> tells which items
\r
283 <entry condition="pot">:cleanup</entry>
\r
285 Cleans up interrupted or aborted operations and
\r
286 unlocks the working tree in <option>/path</option>.
\r
290 <entry condition="pot">:resolve</entry>
\r
292 Marks a conflicted file specified in
\r
293 <option>/path</option> as resolved. If
\r
294 <option>/noquestion</option> is given, then resolving
\r
295 is done without asking the user first if it really
\r
300 <entry condition="pot">:repocreate</entry>
\r
302 Creates a repository in <option>/path</option>
\r
306 <entry condition="pot">:switch</entry>
\r
308 Opens the switch dialog. The <option>/path</option> specifies the
\r
313 <entry condition="pot">:export</entry>
\r
315 Exports the working tree in <option>/path</option>
\r
316 to another directory. If the <option>/path</option>
\r
317 points to an unversioned directory, a dialog will ask
\r
318 for an URL to export to the directory in <option>/path</option>.
\r
322 <entry condition="pot">:merge</entry>
\r
324 Opens the merge dialog. The <option>/path</option> specifies the
\r
327 For merging a revision range, the following options are available:
\r
328 <option>/fromurl:URL</option>,
\r
329 <option>/revrange:string</option>.
\r
330 For merging two repository trees, the following options are available:
\r
331 <option>/fromurl:URL</option>,
\r
332 <option>/tourl:URL</option>,
\r
333 <option>/fromrev:xxx</option> and
\r
334 <option>/torev:xxx</option>.
\r
335 These pre-fill the relevant fields in the merge dialog.
\r
341 <entry condition="pot">:copy</entry>
\r
343 Brings up the branch/tag dialog.
\r
344 The <option>/path</option>
\r
345 is the working tree to branch/tag from.
\r
346 And the <option>/url</option> is the
\r
348 You can also specify the <option>/logmsg</option> switch
\r
349 to pass a predefined log message to the branch/tag dialog.
\r
350 Or, if you don't want to pass the log message on the
\r
351 command line, use <option>/logmsgfile:path</option>,
\r
352 where <option>path</option>
\r
353 points to a file containing the log message.
\r
358 <entry condition="pot">:settings</entry>
\r
360 Opens the settings dialog.
\r
364 <entry condition="pot">:remove</entry>
\r
366 Removes the file(s) in <option>/path</option> from
\r
371 <entry condition="pot">:rename</entry>
\r
373 Renames the file in <option>/path</option>. The new
\r
374 name for the file is asked with a dialog.
\r
375 To avoid the question about renaming similar files
\r
376 in one step, pass <option>/noquestion</option>.
\r
380 <entry condition="pot">:diff</entry>
\r
382 Starts the external diff program specified in the
\r
383 TortoiseGit settings. The <option>/path</option>
\r
384 specifies the first file.
\r
385 If the option <option>/path2</option>
\r
386 is set, then the diff program is started with those
\r
387 two files. If <option>/path2</option> is omitted,
\r
388 then the diff is done between the file in
\r
389 <option>/path</option> and its BASE.
\r
390 To explicitly set the revision use
\r
391 <option>/startrev:xxx</option> and
\r
392 <option>/endrev:xxx</option>.
\r
393 Add <option>/unified</option> to get a unified diff.
\r
394 Add <option>/line:NN</option> to get scroll to the mentioned line.
\r
396 If <option>/blame</option> is set and <option>/path2</option>
\r
397 is not set, then the diff is done by first blaming
\r
398 the files with the given revisions.
\r
403 <entry condition="pot">:showcompare</entry>
\r
406 Depending on revisions to compare and the path, this
\r
407 either shows a unified diff (if the option <option>unified</option> is set),
\r
408 a dialog with a list of files that have changed (filtered by a possibly entered subpath) or if
\r
409 the path point to a file starts the diff viewer for
\r
410 those the file in the different revisions.
\r
415 <entry condition="pot">:conflicteditor</entry>
\r
417 Starts the conflict editor specified in the TortoiseGit
\r
418 settings with the correct files for the conflicted
\r
419 file in <option>/path</option>.
\r
423 <entry condition="pot">:help</entry>
\r
425 Opens the help file.
\r
429 <entry condition="pot">:repostatus</entry>
\r
431 Opens the check-for-modifications dialog. The <option>/path</option>
\r
432 specifies the working tree directory.
\r
436 <entry condition="pot">:repobrowser</entry>
\r
438 Starts the repository browser dialog, pointing to
\r
439 the working tree given in <option>/path</option>.
\r
440 An additional option <option>/rev:xxx</option> can
\r
441 be used to specify the revision which the repository
\r
442 browser should show. If the <option>/rev:xxx</option>
\r
443 is omitted, it defaults to HEAD.
\r
447 <entry condition="pot">:ignore</entry>
\r
449 Adds all targets in <option>/path</option> to the
\r
450 ignore list, i.e. adds the <literal>.gitignore</literal>
\r
451 file to those files.
\r
455 <entry condition="pot">:blame</entry>
\r
458 Opens the blame dialog for the file specified
\r
459 in <option>/path</option>.
\r
462 If the option <option>/endrev</option> is set TortoiseGitBlame
\r
463 ends at that revision.
\r
466 If the option <option>/line:nnn</option> is set,
\r
467 TortoiseGitBlame will open with the specified line
\r
473 <entry condition="pot">:cat</entry>
\r
475 Saves a file from an URL or working tree path given
\r
476 in <option>/path</option> to the location given in
\r
477 <option>/savepath:path</option>. The revision is
\r
478 given in <option>/revision:xxx</option>. This can
\r
479 be used to get a file with a specific revision.
\r
484 <entry condition="pot">:createpatch</entry>
\r
486 Creates a patch file for the path given in
\r
487 <option>/path</option>.
\r
492 <entry condition="pot">:pull</entry>
\r
494 Pull change from remote repository
\r
495 <option>/path</option>.
\r
499 <entry condition="pot">:push</entry>
\r
501 Push change to remote repository
\r
502 <option>/path</option>.
\r
506 <entry condition="pot">:rebase</entry>
\r
508 Rebase commits to special commit.
\r
509 <option>/path</option>.
\r
513 <entry condition="pot">:stashsave</entry>
\r
515 <option>/path. A prefilled mesage can be achieved by using the <option>/msg</option> parameter.</option>.
\r
519 <entry condition="pot">:stashapply</entry>
\r
521 <option>/path</option>.
\r
525 <entry condition="pot">:stashpop</entry>
\r
527 <option>/path</option>.
\r
531 <entry condition="pot">:subadd</entry>
\r
533 <option>/path</option>.
\r
537 <entry condition="pot">:subupdate</entry>
\r
539 <option>/path</option>.
\r
543 <entry condition="pot">:subsync</entry>
\r
545 <option>/path</option>.
\r
549 <entry condition="pot">:reflog</entry>
\r
551 <option>/path</option>.
\r
555 <entry condition="pot">:refbrowse</entry>
\r
557 <option>/path</option>.
\r
561 <entry condition="pot">:updatecheck</entry>
\r
563 <option>/visible</option>: Shows the dialog even if no newer TortoiseGit version is available.
\r
564 <option>/force</option>: Shows file list for download even if the latest TortoiseGit has been installed.
\r
568 <entry condition="pot">:revisiongraph</entry>
\r
570 Shows the revision graph for the path given in
\r
571 <option>/path</option>.
\r
573 To create an image file of the revision graph for a specific path, but
\r
574 without showing the graph window, pass <option>/output:path</option>
\r
575 with the path to the output file. The output file must have
\r
576 an extension that the revision graph can actually
\r
577 export to. These are:
\r
578 <literal>.svg</literal>,
\r
579 <literal>.wmf</literal>,
\r
580 <literal>.gv</literal>,
\r
581 <literal>.png</literal>,
\r
582 <literal>.jpg</literal>,
\r
583 <literal>.bmp</literal> and
\r
584 <literal>.gif</literal>.
\r
589 <entry condition="pot">:daemon</entry>
\r
591 Launch Git Daemon for the path given in
\r
592 <option>/path</option>.
\r
596 <entry condition="pot">:pgpfp</entry>
\r
598 Prints the TortoiseGit Release Signing Key fingerprint. If you trust the current TortoiseGit installation, thius can be used as a trust anchor to future releases.
\r
603 <entry condition="pot">:rebuildiconcache</entry>
\r
605 Rebuilds the windows icon cache. Only use this in
\r
606 case the windows icons are corrupted. A side effect
\r
607 of this (which can't be avoided) is that the icons
\r
608 on the desktop get rearranged.
\r
609 To suppress the message box, pass <option>/noquestion</option>.
\r
618 Examples (which should be entered on one line):
\r
620 TortoiseGitProc.exe /command:commit
\r
621 /path:"d:\git_wc\file1.txt*c:\git_wc\file2.txt"
\r
622 /logmsg:"test log message" /closeonend:2
\r
624 TortoiseGitProc.exe /command:log /path:"c:\git_wc\file1.txt"
\r
625 /startrev:master~100 /endrev:master
\r
630 <sect1 id="tgit-automation-idiff">
\r
631 <title>TortoiseGitIDiff Commands</title>
\r
633 <primary>automation</primary>
\r
636 <primary>command line</primary>
\r
639 The image diff tool has a few command line options which you
\r
640 can use to control how the tool is started.
\r
641 The program is called <literal>TortoiseGitIDiff.exe</literal>.
\r
644 The table below lists all the options which can be passed
\r
645 to the image diff tool on the command line.
\r
648 ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION
\r
649 Don't touch these lines:
\r
650 <entry condition="pot">:about</entry>
\r
652 The condition="pot" prevents the strings from being extracted into
\r
653 the .pot file, so nobody translates them.
\r
654 The colons in front of the command have to stay there to prevent these strings
\r
655 from being translated if the po file "by chance" contains a matching translation.
\r
658 <table id="tgit-automation-idiff-1-table">
\r
659 <title>List of available options</title>
\r
661 <colspec colnum="1" colwidth="2*"/>
\r
662 <colspec colnum="2" colwidth="6*"/>
\r
665 <entry>Option</entry>
\r
666 <entry>Description</entry>
\r
671 <entry condition="pot">:left</entry>
\r
673 Path to the file shown on the left.
\r
677 <entry condition="pot">:lefttitle</entry>
\r
679 A title string. This string is used in the image view
\r
680 title instead of the full path to the image file.
\r
684 <entry condition="pot">:right</entry>
\r
686 Path to the file shown on the right.
\r
690 <entry condition="pot">:righttitle</entry>
\r
692 A title string. This string is used in the image view
\r
693 title instead of the full path to the image file.
\r
697 <entry condition="pot">:overlay</entry>
\r
699 If specified, the image diff tool switches
\r
700 to the overlay mode (alpha blend).
\r
704 <entry condition="pot">:fit</entry>
\r
706 If specified, the image diff tool fits both
\r
711 <entry condition="pot">:showinfo</entry>
\r
713 Shows the image info box.
\r
721 Example (which should be entered on one line):
\r
723 TortoiseGitIDiff.exe /left:"c:\images\img1.jpg" /lefttitle:"image 1"
\r
724 /right:"c:\images\img2.jpg" /righttitle:"image 2"
\r