4

I've recently reinstalled Git, and I just can't get it to run off the native Windows command prompt anymore. I'm sure it is in Path environment variable, as you can see:

C:\Users\Ult>where git
C:\Program Files (x86)\Git\cmd\git.exe

C:\Users\Ult>git --version
'git' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Ult>"C:\Program Files (x86)\Git\cmd\git.exe" --version
git version 1.9.4.msysgit.2

So far I've tried:

  • Close and reopen the command prompt;
  • Reinstall Git once again;
  • Reboot computer;
  • Edit the Path environment variable, moving C:\Program Files (x86)\Git\cmd to the beginning of it.

I've already looked around the web and in SU and couldn't find a solution. Please don't close as a dupe of the existing similar questions which are just about not having Git in the Path or reopening cmd.exe. I've already tried these and they do not solve the issue.

I need to be able to run Git off the native cmd.exe in order for some of my IDE/text editors' Git plugins to work properly. That means I can't just use Git Bash (which works fine).

Running on Windows 7 x64 Ultimate.

2 Answers 2

6

Finally found the actual issue: there was a " in the PATH environment variable.

Everything after " was ignored when trying to run executables from cmd.exe, although the where command could still find them.

2
  • I had a similar problem: I had a space " " just at the end of the PATH variable value due to some wrong script resulting in that situation! where was able to ignore this, but not the bash shell itself...
    – Anthony O.
    Apr 27, 2016 at 15:01
  • I had a similar situation as well. On Windows, some of the paths in the PATH variable ended with \ and some didn't. After adding the final \ to all those who did not end with it before - android recognise git once again.
    – et_l
    Dec 26, 2016 at 11:31
0

I had similar situation But non of the solutions provided here worked What worked for me is to leave the \git.exe away and replace it with:

~\git\bin\

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .