Skip to content

Git for Windows Version information #5319

Closed as not planned
Closed as not planned
@AScott-WWF

Description

@AScott-WWF
  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.47.1.windows.1
cpu: x86_64
built from commit: 2cd22437f64229935dc564db969cbcbfed5e9045
sizeof-long: 4
sizeof-size_t: 8
shell-path: D:/git-sdk-64-build-installers/usr/bin/sh
feature: fsmonitor--daemon
libcurl: 8.11.0
OpenSSL: OpenSSL 3.2.3 3 Sep 2024
zlib: 1.3.1
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.19045.5247]

Windows 10 Enterprise Version 22H2 64-bit

  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
> type "$env:USERPROFILE\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Editor Option: VisualStudioCode
Custom Editor Path:
Default Branch Option:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: ConHost
Git Pull Behavior Option: Merge
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
Enable FSMonitor: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

N/A

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

CMD or PowerShell

** PowerShell commands **
cd C:\Program Files\Git
Get-ChildItem git*.exe -Recurse -Force -ErrorAction SilentlyContinue | Select-Object * -ExpandProperty versioninfo | Sort-Object ProductVersion,FileVersionRaw,Filename | Select-Object ProductVersion,FileVersion,FileVersionRaw,Filename,FileDescription,CompanyName | ft -AutoSize

(Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1\ -Name DisplayVersion).DisplayVersion
  • What did you expect to occur after running these commands?

Consistent Version numbering

  • What actually happened instead?
    The 1st command returns:
ProductVersion                                 FileVersion      FileVersionRaw FileName                                                                 FileDescription        CompanyName
--------------                                 -----------      -------------- --------                                                                 ---------------        -----------
                                                                0.0.0.0        C:\Program Files\Git\mingw64\bin\git-askpass.exe
                                                                0.0.0.0        C:\Program Files\Git\mingw64\bin\git-askyesno.exe
                                                                0.0.0.0        C:\Program Files\Git\mingw64\bin\git-credential-helper-selector.exe
                                                                0.0.0.0        C:\Program Files\Git\mingw64\libexec\git-core\git-credential-wincred.exe
                                                                3.6.0.0        C:\Program Files\Git\mingw64\bin\git-lfs.exe
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\bin\git.exe                                         Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\cmd\git-gui.exe                                     Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\cmd\git-lfs.exe                                     Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\cmd\git-receive-pack.exe                            Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\cmd\git-upload-pack.exe                             Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\cmd\git.exe                                         Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\cmd\gitk.exe                                        Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\git-bash.exe                                        Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\git-cmd.exe                                         Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\mingw64\bin\git-receive-pack.exe                    Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\mingw64\bin\git-upload-archive.exe                  Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\mingw64\bin\git-upload-pack.exe                     Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\mingw64\bin\git.exe                                 Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\mingw64\libexec\git-core\git-daemon.exe             Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\mingw64\libexec\git-core\git-http-backend.exe       Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\mingw64\libexec\git-core\git-http-fetch.exe         Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\mingw64\libexec\git-core\git-http-push.exe          Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\mingw64\libexec\git-core\git-imap-send.exe          Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\mingw64\libexec\git-core\git-remote-ftp.exe         Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\mingw64\libexec\git-core\git-remote-ftps.exe        Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\mingw64\libexec\git-core\git-remote-http.exe        Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\mingw64\libexec\git-core\git-remote-https.exe       Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\mingw64\libexec\git-core\git-sh-i18n--envsubst.exe  Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\mingw64\libexec\git-core\git.exe                    Git for Windows        The Git Development Community
2.47.1.windows.1                               2.47.1.windows.1 2.47.1.1       C:\Program Files\Git\mingw64\share\git\git-wrapper.exe                   Git for Windows        The Git Development Community
2.6.0+3c28096588f549cb46f36b552390514356830abe 2.6.0.0          2.6.0.0        C:\Program Files\Git\mingw64\bin\git-credential-manager.exe              git-credential-manager git-credential-manager

As you can see (for any of the latest Git components) this is either "2.47.1.windows.1" for ProductVersion or FileVersion, but "2.47.1.1" for FileVersionRaw
Whereas the 2nd Command returns "2.47.1" from the DisplayVersion held in the registry

2.47.1
  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

N/A

The problem with this inconsistency is it makes it very difficult to use 'standard' Windows checks to determine the version of the product that is actually installed, As an example we use Microsoft Intune to deploy software to many endpoints and one of the detection methods available to us when a product is deployed is to use a String (Version) check against a defined file (e.g. C:\Program Files\Git\git-cmd.exe), this checks for a standard 4 part version number held in the FileVersion attribute on the chosen file.
As you can see from the above results the FileVersion on your files contains 5 parts. This unfortunately is not a normal 'Windows' defined version number (i.e. Major.Minor.Build.Revision), so this check fails (Unfortunately Intune (and many other deployment tools) does not give the option to choose an (alternative) attribute to use) so for Git for Windows the FileVersion attribute can not be used to detect the installed version.

One question I do have is what is the actual [version] number for this release? is it 2.47.1, 2.47.1.1 or something else?
If it is something else (i.e. "2.47.1.windows.1") I need to find a native Windows method to return the correct standard Windows version number.
One solution I could recommend is for your development build process to put the standard Windows format numeric version number (e.g. 2.47.1.1 into the FileVersion Attribute on your windows compiled executables (.exe) and dynamic linked librarys (.dll) and leave the Product Version as-is, that way many products that attempt to read the version info from an executable or dll file can correctly determine it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions