i_saw_drones
i_saw_drones

Reputation: 3506

SourceTree 1.6.14 cannot find Git 2.4.0 installation on Windows

After installing Git 2.4.0 on my Windows 7 system, I tried to change the option in SourceTree 1.6.14 to "Use System Git", rather than the embedded version.

However, upon clicking "Use System Git", nothing happened and the setting remained set to "Use Embedded Git".

How can I make SourceTree use the installed version of Git?

Upvotes: 3

Views: 2300

Answers (1)

i_saw_drones
i_saw_drones

Reputation: 3506

This will be probably fixed in a future patch for SourceTree, however, until it does there is a workaround as follows.

Git versions prior to 2.0 stored git.exe in a subdirectory called bin and this is what SourceTree is looking for. As of Git >=2.0, git.exe moved into a folder named cmd.

Therefore, the easiest way to get SourceTree to recognise your Git installation, is to create a symbolic link for the folder using mklink as follows:

C:\Program Files (x86)\Git\>mklink /D bin cmd

Edit: Whilst the above fixes Git for the normal GUI operations (commit/push etc.) it does not fix the "Terminal" button, as this command tries to execute sh.exe via the following command and fails as sh.exe has also been moved in Git 2.4.

"C:\Windows\System32\cmd.exe" /c "C:\Program Files (x86)\Git\bin\sh.exe" --login -i

Edit 2: Further reading - this was raised as an issue by the Git for Windows maintainers here.

Upvotes: 4

Related Questions