Git For Windows Silent Install Silent Arguments

8

2

I'm aware of the basic silent install arguments like so.

 Git-1.9.4-preview20140611.exe /SILENT /COMPONENTS="icons,ext\reg\shellhere,assoc,assoc_sh"

However I need to install git with the option 'Run Git from the Windows Command Prompt' I've yet to find a argument for this.

Travis Boatman

Posted 2015-07-24T00:32:17.430

Reputation: 183

I need to do something similar and turn off the credential store in a silent install (with the latest 2.8), and also can't find a way to do it. :( – David Ebbo – 2016-06-14T13:46:58.430

Now it is October 2019, and NONE of the answers here work any longer. The portable edition installer seems determined to pop a GUI window. – Kevin Buchs – 2019-10-08T19:15:13.077

Answers

2

At the current time you must set the registry options beforehand if you want to do so. The Chocolatey package does this based on package parameters you pass to the install command:

choco install git -params '"/GitAndUnixToolsOnPath"'

or

choco install git -params '"/GitOnlyOnPath"'

That said, if you want to get it as an argument, the Git for Windows folks are very accepting of Pull Requests. If you have the InnoSetup installer experience, please contribute at git-for-windows/build-extra.

More Information

If you are curious to see how it works, inspect the files section of the package page and tools\chocolateyInstall.ps1 and you will see the following:

if ($gitCmdOnly) {
  # update registry so installer picks it up automatically
  New-ItemProperty $installKey -Name "Inno Setup CodeFile: Path Option" -Value "Cmd" -PropertyType "String" -Force | Out-Null
}

if ($unixTools) {
  # update registry so installer picks it up automatically
  New-ItemProperty $installKey -Name "Inno Setup CodeFile: Path Option" -Value "CmdTools" -PropertyType "String" -Force | Out-Null
}

ferventcoder

Posted 2015-07-24T00:32:17.430

Reputation: 2 959

10

Use a setup file https://github.com/git-for-windows/git/wiki/Silent-or-Unattended-Installation

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

An example of a parameter file is:

[Setup]
Lang=default
Dir=C:\Program Files (x86)\Git
Group=Git
NoIcons=0
SetupType=default
Components=
Tasks=
PathOption=Cmd
SSHOption=OpenSSH
CRLFOption=CRLFAlways

More information on command-line parameters can be found at http://www.jrsoftware.org/ishelp/index.php?topic=setupcmdline

dinamite

Posted 2015-07-24T00:32:17.430

Reputation: 101

3

You can find all the options for the Windows GIT installer using /?, for example:

> Git-2.9.2-64-bit.exe /?

It will open a window with all the options.

The Git CMD help screen

As this help window shows, I think that either of the following commands will give you what you are looking for:

> Git-2.9.2-64-bit.exe /SILENT

or

> Git-2.9.2-64-bit.exe /VERYSILENT

Geoff Hayward

Posted 2015-07-24T00:32:17.430

Reputation: 39

These only show standard options for common setups, doesn't give how to set specific options – CharlesB – 2017-05-04T15:34:43.413

3

To see what options are available, you can run the installer from a command prompt with the /SAVEINF option:

> .\Git-2.12.2.2-64-bit.exe /SAVEINF="C:\Users\USERNAME\Desktop\git.inf"

Go through the installer, choose the options you want, and install Git. When the installer finishes, you can inspect the git.inf file to see the option and value you need.

Use the INF file you created above as the template for your future silent installs. Run the installer from a command prompt with the /LOADINF="PATH\TO\YOUR\INF.inf".

It looks like the INF option you want is PathOption=Cmd.

splattered bits

Posted 2015-07-24T00:32:17.430

Reputation: 173

-1

The argument you are looking for is:

/PathOption=CmdTools

Floghi

Posted 2015-07-24T00:32:17.430

Reputation: 1