Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git.exe has been suddenly gone on Windows

Tags:

git

window

exe

My machine has been using on Window 8 x64. I have installed Git on my Windows, everything has worked fine. I have configured the "Path to git executable" setting of my IDE (PhpStorm IDE) to the git exe which could be found on the following answer

Where is Git exe located

Here is the location where git.exe has been located on my computer C:\Users[computer-name]\AppData\Local\GitHub\

But today, I got a message from my IDE: Can't start Git: git.cmd. Probably the path to Git executable is not valid. Fix it. (show balloon)

I have checked and the git.exe or git.cmd, they have been gone, I don't know why. I have tried to reuse the GitHubSetup which I've used for installing to repair or reinstall but the GitHub app was still opened normally because it seemed there never has problem with itself. The Github is working on my machine, I can see my repository, commit, etc. But I would like the git.exe to configure for my IDE.

How could I get back that missing file (git.exe)?

like image 446
Telvin Nguyen Avatar asked Dec 16 '22 08:12

Telvin Nguyen


2 Answers

If Git is still available from the command line, then the binary is still around. Have you tried locating it with a search (with bash you could use $ which git to tell you the location. Don't know an equivalent for the Windows command line though)? When you find it, you could try to copy it over to the location you need it for your IDE.

like image 120
Max Leske Avatar answered Dec 28 '22 11:12

Max Leske


Since Git has several installation options I would like to point out that this solution is not for everyone.

This solution is for the following case:

  • OS : Windows 8 (not applicable for any other version)
  • Git is installed as a Command Line Tool
  • Git is installed at a default preset location

The git executable(sh.exe) for Command Line Tool is a script that in order to work will be based on the your windows Command Prompt (cmd.exe)

You will need the following string to refer to Git correctly as an executable:

C:\Windows\SysWOW64\cmd.exe /c ""C:\Program Files (x86)\Git\bin\sh.exe" --login -i"
like image 21
Tim Cason Avatar answered Dec 28 '22 11:12

Tim Cason