'git' is not recognized as an internal or external command

Jason Kim picture Jason Kim · Dec 20, 2010 · Viewed 794.5k times · Source

I have an installation of Git for Windows, but when I try to use the git command in Command Prompt, I get the following error:

'git' is not recognized as an internal or external command,
operable program or batch file. 

How do I fix this problem?

Answer

Abizern picture Abizern · Dec 20, 2010

Have you correctly set your PATH to point at your Git installation?

You need to add the following paths to PATH:

  • C:\Program Files\Git\bin\
  • C:\Program Files\Git\cmd\

And check that these paths are correct – you may have Git installed on a different drive, or under Program Files (x86). Correct the paths if necessary.


Modifying PATH on Windows 10:

  1. In the Start Menu or taskbar search, search for "environment variable".
  2. Select "Edit the system environment variables".
  3. Click the "Environment Variables" button at the bottom.
  4. Double-click the "Path" entry under "System variables".
  5. With the "New" button in the PATH editor, add C:\Program Files\Git\bin\ and C:\Program Files\Git\cmd\ to the end of the list.
  6. Close and re-open your console.

Modifying PATH on Windows 7:

  1. Right-click "Computer" on the Desktop or Start Menu.
  2. Select "Properties".
  3. On the very far left, click the "Advanced system settings" link.
  4. Click the "Environment Variables" button at the bottom.
  5. Double-click the "Path" entry under "System variables".
  6. At the end of "Variable value", insert a ; if there is not already one, and then C:\Program Files\Git\bin\;C:\Program Files\Git\cmd\. Do not put a space between ; and the entry.
  7. Close and re-open your console.

If these instructions weren't helpful, feel free to look at some others: