How to Fix “Git is not recognized” Error on Windows

Learn how to solve the common problem of “Git is not recognized as an internal or external command” on Windows with this easy guide.

Solution 1: Stop and Start Command Prompt

If you have started Windows command prompt in your system before installing Git. So close it and then start it again.

Solution 2: Set Git System Environment Path Variable

If you have installed Git. For this, add the Git installation path to your system’s PATH environment variable:

  • Step 1 – Go to Start and type “environment variables”
  • Step 2 – Edit Environment Setting
  • Step 3 – Edit System Environment Variable Path
  • Step 4 – Add Git to the PATH environment variable
  • Step 5 – Restart Windows CMD
  • Step 6 – Test Git Version

Step 1 – Go to Start and type “environment variables”

First of all, Open the Start menu and search for “Environment Variables” and select “Edit the system environment variables.” like following:

Step 2 – Environment Setting

Then, In the System Properties window, click the “Environment Variables” button; as shown below picture:

Step 3 – Edit System Environment Variable Path

Inside the Environment Variables menu, go to the System variables submenu, select Path, then click the Edit button.; as shown below picture:

Step 4 – Add Git to the PATH environment variable

If Git is not in your PATH, you can add it by clicking “New” and adding the path to the Git executable directory (e.g., “C:\Program Files\Git\cmd”).

Click “OK” to close the “Edit environment variable” dialog, “OK” again to close the “Environment Variables” dialog, and one last “OK” to close the “System Properties” dialog.

Step 5 – Restart Windows CMD

Restart any open command prompt windows, or open a new one. Now, you should be able to run git commands from any directory within the command prompt.

Step 6 – Test Git Version

After following these steps, you should be able to use Git commands without encountering the error message. You can verify that Git is correctly installed and configured by running git --version in the command prompt or PowerShell, which should display the installed Git version.

git --verion

If the output displays the git version, then git has been successfully added to the PATH variable.

Solution 3: Uninstall and Reinstall Git

If you are still getting the same error. To find the best way, you can completely uninstall Git from your system and re-download Git from the official website and then install it.

#windows 

How to Fix “Git is not recognized” Error on Windows
1.30 GEEK