Commands for installing Git without prompts, removing it again and detecting it from deployment tools. A command is shown only when it is certain: from the manifest or the installer technology’s documented default.
Related guide: Silent install switches: MSI, NSIS, Inno Setup · Uninstall a program with the registry or PowerShell
With winget
PowerShell
winget install --id Git.Git -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Git.Git -e --silentwinget uninstall --id Git.Git -e --silentBy installer
64-bit · EXE (Inno Setup) · Current user
Silent install
Git-2.56.0.3-64-bit.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTARTCustom folder
Git-2.56.0.3-64-bit.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /DIR="C:\Apps\git"64-bit · EXE (Inno Setup) · All users
Silent install
Git-2.56.0.3-64-bit.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTARTCustom folder
Git-2.56.0.3-64-bit.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /DIR="C:\Apps\git"ARM64 · EXE (Inno Setup) · Current user
Silent install
Git-2.56.0.3-arm64.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTARTCustom folder
Git-2.56.0.3-arm64.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /DIR="C:\Apps\git"ARM64 · EXE (Inno Setup) · All users
Silent install
Git-2.56.0.3-arm64.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTARTCustom folder
Git-2.56.0.3-arm64.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /DIR="C:\Apps\git"PowerShell: download, verify, install
Downloads the official file, checks its SHA256 and installs it silently.
install-git.ps1
$url = 'https://github.com/git-for-windows/git/releases/download/v2.56.0.windows.3/Git-2.56.0.3-64-bit.exe'
$sha256 = 'DC6D3DB061999136E139F31376C5582A9ED6F36A4EA12F15E54AD7FA2BFC0BF2'
$file = Join-Path $env:TEMP 'Git-2.56.0.3-64-bit.exe'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART' -Wait install-git.ps1
$url = 'https://github.com/git-for-windows/git/releases/download/v2.56.0.windows.3/Git-2.56.0.3-64-bit.exe'
$sha256 = 'DC6D3DB061999136E139F31376C5582A9ED6F36A4EA12F15E54AD7FA2BFC0BF2'
$file = Join-Path $env:TEMP 'Git-2.56.0.3-64-bit.exe'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART' -Wait install-git.ps1
$url = 'https://github.com/git-for-windows/git/releases/download/v2.56.0.windows.3/Git-2.56.0.3-arm64.exe'
$sha256 = '53CFE6358A1F0573C8C777C9AD71151DF8F29986759C689C7B8A5CBB84CCA495'
$file = Join-Path $env:TEMP 'Git-2.56.0.3-arm64.exe'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART' -Wait install-git.ps1
$url = 'https://github.com/git-for-windows/git/releases/download/v2.56.0.windows.3/Git-2.56.0.3-arm64.exe'
$sha256 = '53CFE6358A1F0573C8C777C9AD71151DF8F29986759C689C7B8A5CBB84CCA495'
$file = Join-Path $env:TEMP 'Git-2.56.0.3-arm64.exe'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART' -Wait