How to resolve the error "git is not recognized" on windows

Greg Foster
Greg Foster
Graphite software engineer

Encountering the error "git is not recognized" or "git command not found" typically indicates that Git is either not installed on your system or its installation path is not included in the system's PATH environment variable. This guide will help you troubleshoot and resolve these issues, ensuring that Git commands operate smoothly in your terminal or command prompt.

The first step is to check whether Git is installed on your Windows machine.

  • Open the command prompt or PowerShell and run:

    git --version

  • If Git is installed, you should see a version number as output.

screenshot of git version output

  • If you see an error like "git is not recognized as an internal or external command proceed to the next steps.

If Git is not installed, you'll need to download and install it.

  • Download git: Visit the official Git website to download the latest version of Git for Windows.

  • Run the installer: Execute the downloaded file and follow the installation prompts. Default options are typically sufficient for most users.

  • Verify installation: Reopen the Command Prompt or PowerShell and type git --version to confirm Git is now recognized.

If Git is installed but not recognized, it's likely not added to the PATH environment variable. Adding Git to the PATH allows the system to locate the Git executable from any command line interface.

  • Find git installation path: The default installation path is usually C:\Program Files\Git\cmd. Verify this location exists or find where Git is installed on your machine.

  • Edit system PATH:

    • Open the Start Menu Search, type in env, and choose "Edit the system environment variables".

    • In the System Properties window, click on "Environment Variables".

    • Under "System variables", scroll to find the "Path" variable and select it, then click "Edit".

    • Click "New" and paste the path to your Git cmd folder (e.g., C:\Program Files\Git\cmd).

    • Click "OK" to close all dialogs and apply these changes.

  • Verify the change: Close and reopen your Command Prompt or PowerShell and type git --version to ensure Git is now recognized.

Sometimes, the issue might be as simple as a typo in the Git command you're trying to execute. Ensure you're typing the command correctly, such as git clone instead of incorrectly spelled variations like gti clone.

If you continue to experience issues in the Command Prompt or PowerShell, consider using Git Bash, which is installed alongside Git for Windows. Git Bash provides a Unix-like terminal where Git commands should work without additional configuration.

screenshot of Git For Windows

  • Find and open Git Bash: Locate Git Bash in your Start Menu or use the search function to find it.

  • Try Your Git command: Use Git Bash to run the Git command that was previously not recognized.

As a last resort, if Git still isn't recognized, there might have been an issue with the initial installation.

  • Uninstall Git: Go to "Control Panel" > "Programs and Features", find Git in the list, and uninstall it.

  • Reinstall Git: Download the latest version of Git for Windows and follow the installation process again, making sure to add Git to the PATH during installation.

For further reading check out the official Git For Windows documentation.

Stay unblocked. Ship faster.
Experience the new developer workflow - create, review, and merge code continuously. Get started with one command.
Get started

Give your PR workflow
an upgrade today

Stack easier | Ship smaller | Review quicker

Or install our CLI.
Product Screenshot 1
Product Screenshot 2