🔗Using Command-Line Options

It is possible to install Git for Windows silently using the following flags when called from a command-line prompt:

Git-<version>-<bitness>.exe /VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /COMPONENTS="icons,ext\reg\shellhere,assoc,assoc_sh"

🔗Using Installer Options From a File

You can also load install parameters from a file with /LOADINF="filename", and you can record parameters to a file using /SAVEINF="filename".

Example for saving selected options to a file during an interactive run started from the command-line:

Git-<version>-<bitness>.exe /SAVEINF=git_options.ini

Example reusing that previously created file to silently install Git in unattended mode:

Git-<version>-<bitness>.exe /VERYSILENT /NORESTART /NOCANCEL /LOADINF=git_options.ini

An example of a parameter file is:

[Setup]
Lang=default
Dir=C:\Program Files\Git
Group=Git
NoIcons=0
SetupType=default
Components=gitlfs,assoc,assoc_sh,windowsterminal
Tasks=
EditorOption=VIM
CustomEditorPath=
DefaultBranchOption=main
PathOption=Cmd
SSHOption=OpenSSH
TortoiseOption=false
CURLOption=WinSSL
CRLFOption=CRLFCommitAsIs
BashTerminalOption=MinTTY
GitPullBehaviorOption=Merge
UseCredentialManager=Enabled
PerformanceTweaksFSCache=Enabled
EnableSymlinks=Disabled
EnablePseudoConsoleSupport=Disabled
EnableFSMonitor=Disabled

🔗Installer Options

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 (for custom options added only to Git for Windows’ installer).

🔗Custom Installer Options

A list of installer custom options as of Git for Windows v2.42.0.windows.2 is below:

Key                    Values                    Default                         Remark                         
EditorOptionNano, VIM, Notepad++, VisualStudioCode, VisualStudioCodeInsiders, SublimeText, Atom, VSCodium, Notepad, Wordpad, CustomEditorVIM
CustomEditorPathPath and options for custom text editor (only in combination with EditorOption=CustomEditor)
DefaultBranchOptionDefault branch name
PathOptionBashOnly, Cmd, CmdToolsCmd
SSHOptionOpenSSH, ExternalOpenSSH, PlinkOpenSSH
TortoiseOptiontrue, falsefalseOnly in combination with SSHOption=Plink
CurlOptionOpenSSL, WinSSLOpenSSL
CRLFOptionLFOnly, CRLFAlways, CRLFCommitAsIsCRLFAlways
BashTerminalOptionMinTTY, ConHostMinTTY
GitPullBehaviorOptionMerge, Rebase, FFOnlyMerge
UseCredentialManagerEnabled, Disabled, CoreEnabledCore does exactly the same as Enabled and exists for historical reasons
PerformanceTweaksFSCacheEnabled, DisabledEnabled
EnableSymlinksAuto, Enabled, DisabledAuto
AddmandatoryASLRsecurityexceptionsAuto, Enabled, DisabledAuto
EnableBuiltinDifftoolAuto, Enabled, DisabledAuto
EnableBuiltinRebaseAuto, Enabled, DisabledAuto
EnableBuiltinStashAuto, Enabled, DisabledAuto
EnableBuiltinInteractiveAddAuto, Enabled, DisabledAuto
EnablePseudoConsoleSupportAuto, Enabled, DisabledAuto
EnableFSMonitorAuto, Enabled, DisabledAuto