Les commandes pour installer Git sans aucune question, le désinstaller et le détecter depuis un outil de déploiement. Une commande n’apparaît que si elle est certaine : issue du manifeste ou valeur par défaut documentée de la technologie d’installation.
Guide associé: Installation silencieuse : MSI, NSIS, Inno Setup · Désinstaller un programme via le registre ou PowerShell
Avec 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 --silentPar installateur
64 bits · EXE (Inno Setup) · Utilisateur actuel
Installation silencieuse
Git-2.56.1-64-bit.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTARTDossier personnalisé
Git-2.56.1-64-bit.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /DIR="C:\Apps\git"64 bits · EXE (Inno Setup) · Tous les utilisateurs
Installation silencieuse
Git-2.56.1-64-bit.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTARTDossier personnalisé
Git-2.56.1-64-bit.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /DIR="C:\Apps\git"ARM64 · EXE (Inno Setup) · Utilisateur actuel
Installation silencieuse
Git-2.56.1-arm64.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTARTDossier personnalisé
Git-2.56.1-arm64.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /DIR="C:\Apps\git"ARM64 · EXE (Inno Setup) · Tous les utilisateurs
Installation silencieuse
Git-2.56.1-arm64.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTARTDossier personnalisé
Git-2.56.1-arm64.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /DIR="C:\Apps\git"PowerShell : télécharger, vérifier, installer
Télécharge le fichier officiel, vérifie son empreinte SHA256 et l’installe en mode silencieux.
install-git.ps1
$url = 'https://github.com/git-for-windows/git/releases/download/v2.56.1.windows.1/Git-2.56.1-64-bit.exe'
$sha256 = 'C330C72E10B408CC39994BFEFDB63542B0D93D21699325C3E0BD874AF8A5A559'
$file = Join-Path $env:TEMP 'Git-2.56.1-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.1.windows.1/Git-2.56.1-64-bit.exe'
$sha256 = 'C330C72E10B408CC39994BFEFDB63542B0D93D21699325C3E0BD874AF8A5A559'
$file = Join-Path $env:TEMP 'Git-2.56.1-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.1.windows.1/Git-2.56.1-arm64.exe'
$sha256 = '6FE770B534A459D1158011E6EC0CD8390A3BCF44E542BEE9E9A650310E111234'
$file = Join-Path $env:TEMP 'Git-2.56.1-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.1.windows.1/Git-2.56.1-arm64.exe'
$sha256 = '6FE770B534A459D1158011E6EC0CD8390A3BCF44E542BEE9E9A650310E111234'
$file = Join-Path $env:TEMP 'Git-2.56.1-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