4

I'm getting the infamous "'git' is not recognized as an internal or external command, operable program or batch file" after installing msysgit for Windows.

This is not the first time something like this happens; it happened when I tried to set up Python, too, but back then, I found the relevant directory to point my python system variable to, after which it worked.

I've tried different git directories, but I haven't had any luck setting up a system variable for git.

Does anyone know the location of the directory I have to point Windows to in order to understand the git system variable in the command prompt?

1
  • I think I've botched something during installation. For the time being, I'll use Git Bash and reinstall the program later to check. Thanks for all the answers. Commented Nov 2, 2010 at 14:16

2 Answers 2

3

Strange: the only thing I need to make sure after a msysgit installation is for my PATH to reference the cmd directory of said msysgit installation.

By default:

 C:\Program Files\Git\cmd

It contains the git.cmd script which will call the right executable.

Sign up to request clarification or add additional context in comments.

1 Comment

Cute; another program that will cause trouble if the uninitiated will run it from within batch files ;-)
3

Restart Windows. It's the only way to make sure that changes to PATH environmental variable are taken into account by all programs.

2 Comments

If you edit the environment variables through the control panel applet Explorer will re-read them to make sure programs started afterwards will use them. Since Explorer is the root for interactively started applications this works.
Also if installers are setting the value (you can see the changed values in a new cmd window), this works. You might start the git-bash from within another software (e.g. Total Commander). In that case, that application passes on the (old) environment to git-bash. Restart that application and you're fine again. This answer is more mythical than technically helpful I must admit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.