If you’ve encountered the “Git not recognized” error, you’re not alone. This error typically happens when your computer can’t find Git. In simple terms, Git is either not installed on your system or its installation directory hasn’t been added to your system’s PATH environment variable.
Table of Contents
In this guide, we’ll walk you through what this error means and show you how to resolve it step by step.
What Does the Error Mean?
This error message essentially tells you that your computer doesn’t know where to find the Git command. There are two main reasons why this could happen:
1. Git is Not Installed
If Git isn’t installed on your computer, you won’t be able to use Git commands. You’ll need to install it.
2. Git is Not Added to Your PATH
If Git is already installed but its directory isn’t added to your system’s PATH, the computer won’t know where to look for the git
command. PATH is an environment variable that tells your operating system where to find various executables, including Git.
Now, let’s dive into how to resolve these problems.

Step-by-Step Guide to Fixing the “Git Not Recognized” Error
1. Install Git (if not already installed)
The first thing you need to do is ensure that Git is installed on your computer.
How to Install Git:
- Go to the Official Git Website:
Visit https://git-scm.com/downloads to download the latest version of Git. - Run the Installer:
Once the download is complete, open the installer. You’ll be presented with several installation options.- On Windows, there will be an option that says something like “Adjusting your PATH environment.” Be sure to select the option that automatically adds Git to your PATH.
- Complete the Installation:
Follow the installation steps until it is finished. After that, Git should be installed on your system, and the issue should be resolved if it was caused by Git not being installed.
2. Add Git to Your PATH (If Git is Already Installed)
If Git is already installed but you’re still seeing the error, it’s likely that Git’s installation folder hasn’t been added to your system’s PATH environment variable. Here’s how you can fix that:
Finding Git’s Installation Directory:
The installation folder is typically located in one of these paths:
- For 64-bit systems:
C:\Program Files\Git\bin
- For 32-bit systems:
C:\Program Files (x86)\Git\bin
Alternatively, Git may be located in the cmd
folder:
C:\Program Files\Git\cmd
Once you’ve found the correct folder, you’ll need to add it to your system’s PATH.
How to Add Git to PATH:
- Open System Properties:
Click on the Start Menu, then search for “Environment Variables” and select the option that says “Edit the system environment variables.” - Open Environment Variables Settings:
In the System Properties window that appears, click on the Environment Variables button. - Edit the System PATH Variable:
Under the System variables section, look for the variable named Path and select it. Then click on Edit. - Add Git’s Path to the List:
In the Edit Environment Variable window, click on New and paste the Git installation path you located earlier (e.g.,C:\Program Files\Git\bin
). - Save Your Changes:
Click OK to save the changes and close all open windows.
Restart the Command Prompt:
The changes won’t take effect until you open a new Command Prompt window. Close any open command prompt windows and open a new one.
3. Verify Your Installation
After following the steps above, you can check if Git is installed and working correctly.
How to Check:
- Open a new Command Prompt or Terminal window.
- Type the following command:
git --version
- Press Enter.
If Git is installed correctly and the PATH is set up, you should see the version of Git installed on your computer, something like:
git version 2.34.1.windows.1
4. Troubleshooting Tips
If you’re still experiencing the issue, here are a few things to double-check:
- Ensure There Are No Typos in the PATH:
Make sure the path you added is correct and doesn’t have any spelling mistakes. - Ensure PATH Changes Are Saved:
Sometimes, changes to environment variables might not take effect. Double-check that you’ve clicked OK in all the windows to save your changes. - Restart Your Computer (If Necessary):
If the error persists, try restarting your computer to ensure all changes are applied properly.
At End
The “Git not recognized” error is a common issue that usually happens when Git is either not installed or its path is not properly set up in the system’s PATH environment variable. Thankfully, it’s an easy fix! By following the steps in this guide, you should be able to resolve the error and start using Git without any problems.
If you’re still encountering issues after following the steps above, don’t hesitate to check out more detailed troubleshooting guides online or contact Git support for further assistance.
By installing Git or updating your PATH, you’ll be all set to manage your repositories and start using version control to keep track of your code changes!
Read More :