|
| 1 | +## Using Command-Line Options |
| 2 | + |
1 | 3 | It is possible to install Git for Windows silently using the following flags when called from a command-line prompt: |
| 4 | + |
2 | 5 | ``` |
3 | 6 | Git-<version>-<bitness>.exe /VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /COMPONENTS="icons,ext\reg\shellhere,assoc,assoc_sh" |
4 | 7 | ``` |
5 | 8 |
|
6 | | -An example of this is |
| 9 | +## Using Installer Options From a File |
| 10 | + |
| 11 | +You can also load install parameters from a file with `/LOADINF="filename"`, and you can record parameters to a file using `/SAVEINF="filename"`. |
| 12 | + |
| 13 | +Example for saving selected options to a file: |
| 14 | + |
7 | 15 | ``` |
8 | | -Git-2.12.2.2-64-bit.exe /VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /COMPONENTS="icons,ext\reg\shellhere,assoc,assoc_sh" |
| 16 | +Git-<version>-<bitness>.exe /SAVEINF=git_options.ini |
9 | 17 | ``` |
10 | 18 |
|
11 | | -You can find all of the possible flags to use by calling the installer with the `/?` flag (for the options supported by InnoSetup out of the box), and by inspecting the [`install.iss` file](https://github.com/git-for-windows/build-extra/blob/HEAD/installer/install.iss) (for custom options added only to Git for Windows' installer). |
| 19 | +Example reusing that previously created file to silently install Git in unattended mode: |
12 | 20 |
|
13 | | -You can also load install parameters from a file with `/LOADINF="filename"`, and you can record parameters to a file using `/SAVEINF="filename"`. |
| 21 | +``` |
| 22 | +Git-<version>-<bitness>.exe /VERYSILENT /NORESTART /NOCANCEL /LOADINF=git_options.ini |
| 23 | +``` |
14 | 24 |
|
15 | 25 | An example of a parameter file is: |
16 | 26 |
|
17 | | -``` |
| 27 | +```ini |
18 | 28 | [Setup] |
19 | 29 | Lang=default |
20 | 30 | Dir=C:\Program Files\Git |
21 | 31 | Group=Git |
22 | 32 | NoIcons=0 |
23 | 33 | SetupType=default |
24 | | -Components= |
| 34 | +Components=gitlfs,assoc,assoc_sh,windowsterminal |
25 | 35 | Tasks= |
| 36 | +EditorOption=VIM |
| 37 | +CustomEditorPath= |
| 38 | +DefaultBranchOption=main |
26 | 39 | PathOption=Cmd |
27 | 40 | SSHOption=OpenSSH |
28 | | -CRLFOption=CRLFAlways |
| 41 | +TortoiseOption=false |
| 42 | +CURLOption=WinSSL |
| 43 | +CRLFOption=CRLFCommitAsIs |
| 44 | +BashTerminalOption=MinTTY |
| 45 | +GitPullBehaviorOption=Merge |
| 46 | +UseCredentialManager=Enabled |
| 47 | +PerformanceTweaksFSCache=Enabled |
| 48 | +EnableSymlinks=Disabled |
| 49 | +EnablePseudoConsoleSupport=Disabled |
| 50 | +EnableFSMonitor=Disabled |
29 | 51 | ``` |
30 | 52 |
|
31 | | -More information on commandline parameters can be found in [InnoSetup's documentation](http://www.jrsoftware.org/ishelp/index.php?topic=setupcmdline). |
| 53 | +## Installer Options |
| 54 | + |
| 55 | +You can find all of the possible flags to use by calling the installer with the `/?` flag (for the options supported by [InnoSetup](http://www.jrsoftware.org/ishelp/index.php?topic=setupcmdline) out of the box), and by inspecting the [`install.iss` file](https://github.com/git-for-windows/build-extra/blob/HEAD/installer/install.iss) (for custom options added only to Git for Windows' installer). |
| 56 | + |
| 57 | +### Custom Installer Options |
| 58 | + |
| 59 | +A list of installer custom options as of Git for Windows v2.42.0.windows.2 is below: |
| 60 | + |
| 61 | +| Key | Values | Default | Remark | |
| 62 | +| ---------------------------------- | -------| ------- | ------ | |
| 63 | +| EditorOption | Nano, VIM, Notepad++, VisualStudioCode, VisualStudioCodeInsiders, SublimeText, Atom, VSCodium, Notepad, Wordpad, CustomEditor | VIM | | |
| 64 | +| CustomEditorPath | | | Path and options for custom text editor (only in combination with EditorOption=CustomEditor) | |
| 65 | +| DefaultBranchOption | | | Default branch name | |
| 66 | +| PathOption | BashOnly, Cmd, CmdTools | Cmd | | |
| 67 | +| SSHOption | OpenSSH, ExternalOpenSSH, Plink | OpenSSH | | |
| 68 | +| TortoiseOption | true, false | false | Only in combination with SSHOption=Plink | |
| 69 | +| CurlOption | OpenSSL, WinSSL | OpenSSL | | |
| 70 | +| CRLFOption | LFOnly, CRLFAlways, CRLFCommitAsIs | CRLFAlways | | |
| 71 | +| BashTerminalOption | MinTTY, ConHost | MinTTY | | |
| 72 | +| GitPullBehaviorOption | Merge, Rebase, FFOnly | Merge | | |
| 73 | +| UseCredentialManager | Enabled, Disabled, Core | Enabled | Core does exactly the same as Enabled and exists for historical reasons | |
| 74 | +| PerformanceTweaksFSCache | Enabled, Disabled | Enabled | | |
| 75 | +| EnableSymlinks | Auto, Enabled, Disabled | Auto | | |
| 76 | +| AddmandatoryASLRsecurityexceptions | Auto, Enabled, Disabled | Auto | | |
| 77 | +| EnableBuiltinDifftool | Auto, Enabled, Disabled | Auto | | |
| 78 | +| EnableBuiltinRebase | Auto, Enabled, Disabled | Auto | | |
| 79 | +| EnableBuiltinStash | Auto, Enabled, Disabled | Auto | | |
| 80 | +| EnableBuiltinInteractiveAdd | Auto, Enabled, Disabled | Auto | | |
| 81 | +| EnablePseudoConsoleSupport | Auto, Enabled, Disabled | Auto | | |
| 82 | +| EnableFSMonitor | Auto, Enabled, Disabled | Auto | | |
0 commit comments