Ordres per instal·lar Git for Windows SDK sense preguntes, desinstal·lar-lo i detectar-lo des d’eines de desplegament. Només es mostra una ordre quan és segura: la que indica el manifest o el valor per defecte documentat de la tecnologia de l’instal·lador.
Guia relacionada: Instal·lació silenciosa: MSI, NSIS, Inno Setup · Desinstal·lar un programa amb el registre o PowerShell
Amb winget
PowerShell
winget install --id Git.SDK -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Git.SDK -e --silentwinget uninstall --id Git.SDK -e --silentPer instal·lador
64 bits · EXE
Instal·lació silenciosa
git-sdk-installer-1.0.8-64.7z.exe -y32 bits · EXE
Instal·lació silenciosa
git-sdk-installer-1.0.8-32.7z.exe -yPowerShell: baixar, verificar, instal·lar
Baixa el fitxer oficial, en comprova l’SHA256 i l’instal·la en mode silenciós.
install-git-for-windows-sdk.ps1
$url = 'https://github.com/git-for-windows/build-extra/releases/download/git-sdk-1.0.8/git-sdk-installer-1.0.8-64.7z.exe'
$sha256 = 'FC0B4FCFBF8FB9EDB59D71958100441F5428EBB061D32C2F23DB4099907D18D6'
$file = Join-Path $env:TEMP 'git-sdk-installer-1.0.8-64.7z.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 '-y' -Wait install-git-for-windows-sdk.ps1
$url = 'https://github.com/git-for-windows/build-extra/releases/download/git-sdk-1.0.8/git-sdk-installer-1.0.8-32.7z.exe'
$sha256 = '086D7F99E0085E0D6111B2458FDE8B27DFE8BEC064D9DC7C392A183564E7EA6A'
$file = Join-Path $env:TEMP 'git-sdk-installer-1.0.8-32.7z.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 '-y' -Wait