How to Force All Windows PCs to the Same Git Version Using Intune

Ensuring Every PC Runs the Same Git Version with Intune

Keeping your development tools consistent across hundreds of Windows PCs can feel impossible—especially when app discovery shows half your fleet still on an old Git release. Intune’s simple “Application update” feature works great for Store apps, but Win32 apps like Git need a bit more care. Here’s a clear guide to roll out Git 2.51.0, remove old versions, and guarantee every device stays up to date.

1. Package Git 2.51.0 as a Win32 App

First, grab the official Git for Windows installer (MSI or EXE) for version 2.51.0. Then use the Intune Win32 App Packaging Tool:

  • Wrap the installer into an .intunewin file

  • Provide install commands (msiexec /i Git-2.51.0.msi /quiet /norestart)

  • Specify uninstall commands for the new installer if it needs removal later

This turns Git into a fully managed Win32 app in Intune.

2. Set Precise Detection Rules

Detection rules tell Intune when the right version is already installed. For Git 2.51.0, you might use:

  • Registry rule: check HKLM\SOFTWARE\GitForWindowsVersion equals 2.51.0

  • Or file rule: inspect %ProgramFiles%\Git\cmd\git.exe file version equals 2.51.0

With these rules, Intune skips the install on devices that already have the correct build.

3. Uninstall Old Git Versions First

To clear out outdated Git installs, bundle a PowerShell script that runs before the new setup. For example:

powershell
Get-WmiObject -Class Win32_Product |
Where-Object { $_.Name -like 'Git*' -and $_.Version -ne '2.51.0' } |
ForEach-Object { msiexec.exe /x $_.IdentifyingNumber /quiet /norestart }

In the Win32 app’s Program settings, configure the uninstall script as a pre-installation action. This ensures any Git version other than 2.51.0 gets removed automatically.

4. Assign the App to All Devices

Under Assignments, mark the Git 2.51.0 package as Required for your entire device collection (or a specific group of developers). Intune will push the package and enforce it on every targeted PC.

5. Monitor Deployment and Compliance

Finally, open Monitor → Device install status in the Intune console. You’ll see which devices have successfully installed Git 2.51.0 and which ones are still in progress or facing errors. Devices that don’t meet the detection rules will retry until they do.


By packaging Git as a Win32 app with version-based detection and a cleanup script, you take full control of which release is running on every machine. No more half-updated fleets—just a consistent, reliable environment for all your developers.