# Possible bug: GIT\_EXECUTABLE handling

**URL:** <https://discourse.cmake.org/t/possible-bug-git-executable-handling/15899>\
**Category:** Code\
**Tags:** os:windows\
**Created:** [November 3, 2026, 6:29pm UTC](https://discourse.cmake.org/t/possible-bug-git-executable-handling/15899 "2026-11-03T18:29:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![franki](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/f/71c47a/32.png) [@franki](https://discourse.cmake.org/u/franki)\
**Post date:** [November 3, 2026, 6:29pm UTC](https://discourse.cmake.org/t/possible-bug-git-executable-handling/15899/1 "2026-11-03T18:29:16Z")

</div>

Just discovered this behavior while using cmake 3.1.16 on Windows. No other reports on this variable so I presume it may still lurk as bug (or surprise).

I have two Gits installed on my system, and I want cmake to use the second one; without intervention, it finds the first one. There are two methods I know:

Set an environment variable:

set GIT\_EXECUTABLE=C:/second/git/cmd

or

cmake command line argument:

-DGIT\_EXECUTABLE=C:/second/git/cmd/git.exe

Note the 2nd method requires the path include the executable! If the .exe name is omitted, things will appear to work until use of $(GIT\_EXECUTABLE) within cmake CMLs or modules.
