Fix: git is not recognized as an internal or external command, operable program, or batch file error?

     

Several users report getting the “git’ is not recognized as an internal or external command” error when trying lớn run a git command in Command Prompt. While some users reported that this issue has occurred sometime after they installed Git for Windows, others face this issue as soon as the Git installation is complete.

Bạn đang xem: Fix: git is not recognized as an internal or external command, operable program, or batch file error?

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

Method 2: Using the Automatic way of adding GIT path lớn Variables

If you want khổng lồ stay away from messing with PATH variables, you can resolve the“git’ is not recognized as an internal or external command” error by using the Git installation GUI to lớn automatically create the Path variables for you. Doing this will enable you khổng lồ use Git from both Git Bash and from Windows Command Prompt.

Here’s a quick guide on uninstalling Git và then configuring the initial installation lớn automatically địa chỉ cửa hàng the path variables for you:

Press Windows key + R to xuất hiện up a Run dialog box. Then, type “appwiz.cpl” và press Enter to mở cửa up the Programs and Features window.
*
Run dialog: appwiz.cplInside Programs and Features, look for a Git entry, right-click on it and click Uninstall. Then, follow the on-screen prompts khổng lồ remove the current installation of Git.
*
Uninstall your current Git versionRestart your computer khổng lồ complete the uninstallation process.Open the installation executable and follow on with the installation prompts. You can leave all the options khổng lồ the default values. When you get khổng lồ the Adjusting your PATH environment, make sure you select the Use Git from Windows Command Prompt toggle.
*
Select Use Git from the Windows Command PromptContinue the installation configuration by leaving the mặc định selected values (or select your own), then click the Install button.
*
Installing Git for WindowsOnce the installation is complete, restart your computer. At the next startup, you will be able to run commands directly from Windows Command Prompt.

Xem thêm: So Sánh Ip6S Và 6 Plus Và 6S Có Nâng Cấp Gì Hot? Khác Biệt Giữa Iphone 6S Plus Và Iphone 6 Plus

If you’re looking for a method that will resolve the issue without having to uninstall the Git client, move down to the next method below.


Method 3: Adding the variable PATH manually

If you’ve come this far without a result, it is very likely that you’re seeing this particular issue because the Git variable is not configured (or improperly configured) in the Environment Variables.

Luckily, you can configure the Variable value manually by following a mix of instructions. Here’s what you need to do:

Open tệp tin Explorer and navigate lớn the location of the cmd thư mục inside the Git installation. Here are the mặc định paths for x86 & x64 versions:

My Computer (This PC) > Local Disk(C:) > Program Files (x86) > Git > cmdMy Computer (This PC) > Local Disk(C:) > Program Files > Git > cmdNext, right-click on git.exe & choose Properties. Then, in the General tab of git.exe Properties, copy the location of the executable (we’ll need it later).

*
Copy the location of git.exeNext, press Windows key + R to xuất hiện up a Run dialog box, then type “sysdm.cpl” and press Enterto open the System Properties menu.
*
Run dialog: sysdm.cplInside the System Properties menu, go khổng lồ the Advanced tab & click on Environment Variables.
*
Go khổng lồ the Advanced tab & click on Environment VariablesInside the Environment Variables menu, go khổng lồ the System variables submenu, select Path, then click the Edit button.
*
Go lớn System Variables, select Path and click the Edit buttonIn the Edit environment variables window, click the New button and simply paste the location that we copied at step 2. Then, hit Enter to lớn create the variable.
*
Click on New and paste the git.exe’s locationClick OKon every opened prompt khổng lồ ensure that the change is saved.Open a CMD window & type “git”. You should no longer encounter the“git’ is not recognized as an internal or external command” error.
*
Git terminal error is now resolved
qqlive| j88