how to fix git : The term ‘git’ is not recognized as the name of a cmdlet

Autopublished from RSS Original article

The error message “The term ‘git‘ is not recognized as the name of a cmdlet” typically means that Git is not installed on your system, or that it’s not accessible from your system’s PATH.

Here are some steps to troubleshoot this issue:

  1. Check if Git is installed: Open a new command prompt or PowerShell window and type **_git --version_**. If Git is installed, this command should return the installed version of Git. If it returns a message similar to ‘git’ is not recognized as an internal or external command, it means that Git is not installed.

  2. Install Git: If Git is not installed, you can download it from the official Git website (https://git-scm.com/) and follow the installation instructions. After installation, open a new command prompt or PowerShell window and again type **_git --version_** to confirm the installation.

  3. Check the PATH: If Git is installed but the git command is not recognized, it might be that the path to the Git executable is not in your system’s PATH. To check this, type **_echo %PATH%_** in the command prompt or **_$Env:Path_** in PowerShell and press Enter. This will print out the directories in your system’s PATH. Look for a path that includes **_Git\cmd_**. If it’s not there, you’ll need to add it.

  4. Add Git to the PATH: If the path to the Git executable is not in your system’s PATH, you can add it manually. The exact path depends on where Git is installed, but by default, it’s usually **_C:\Program Files\Git\cmd_** or **_C:\Users\YourUserName\AppData\Local\Programs\Git\cmd_**.

To add a new PATH environment variable in Windows 10, follow these steps:

  1. Press Win + X to open the Power User menu, then choose “System”.
  2. Click on “Advanced system settings” on the right side of the System window.
  3. In the System Properties window that opens, go to the “Advanced” tab and click on “Environment Variables”.
  4. In the Environment Variables window, under “System variables”, find and select the “Path” variable, then click “Edit”.
  5. In the Edit Environment Variable window, click “New” and type in the full path of the directory that you want to add to the system PATH.
  6. Click “OK” to close all the windows.

Remember, after adding a new PATH, you’ll need to open a new command prompt or PowerShell window to see the changes, as changes to the PATH don’t affect already-open windows.

Be careful while modifying the PATH. If you accidentally change the existing paths, it might cause some programs to stop working. Always make sure to click “New” to add a new path, rather than modifying an existing one.

The post how to fix git : The term ‘git’ is not recognized as the name of a cmdlet appeared first on Abhay Singh.

Did you find this article valuable?

Support Abhay Singh by becoming a sponsor. Any amount is appreciated!