Alternative
Amazon
Article
Writing
Art
AI
Angular
Photoshop
Premiere
Animal Crossing
Blog
Story
Android
Android Studio
Davinci Resolve
CSS
Clipchamp
ChatGPT
Crypto
DALL-E
Discord
Davinci Resolve
Davinci Resolve 18
Dream Studio
Express
Filmora
Flutter
PC Games
Git
GPT
GPT3
GPT4
GTA
GTA 6
Ghost Together
Ghost Together
HTML
iOS
iMovie
Illustrator
JavaScript
Mac
Mongo
Midjourney
Minecraft
Node.js
NBA 2k24
OSX
PHP
Palworld
Python
Playground AI
Roblox
React
Recipe (Cooking)
React Native
Semicolon.dev
Starfield PC Game
Snapchat
Steam
Stable Diffusion
SVG
Threads
Text To Image (AI)
VSCode
Vim
Web Development
Windows
WebGL
Git Tutorials

    How To Fix Git Is Not Recognized As An Internal Or External Command Operable Program Or Batch File Error

    You will get this error for two main reasons. One, is Git is not installed on your system at all. Head over to official git page, download it and run the installation file. And second, Git is installed, but it's installation path wasn't added to Environment Variables on your Windows system.

    git is not recognized as an internal or external command, operable program or batch file

    This error means just what it says. In attempt to find a command, executable program, or batch file, Windows failed to do it, after searching anywhere in the system.

    Or just watch this quick YouTube video explaining how to fix git not recognized error:

    How to fix: git not recognized as a command, program or batch file error

    Note, this doesn't mean Git isn't installed. Just that it isn't added to environment variables.

    In case of git, however, this means Windows cannot find git.exe command.

    Type git --version on the command line:

    C:\>git --version
    git version 2.39.1.windows.1

    But what if you get an error every time you run git command? Like this one:

    C:\>git --version
    'git' is not recognized as an internal or external command,
    operable program or batch file.

    This is not a git error. It's a Windows error.

    You can type asdasd into command prompt, and you'll get the same error for asdasd.

    If the folder your Git was installed in was not added to Environment Variables, you will not be able to run git command from anywhere on your hard drive, except that folder.

    This tutorial was created to help you fix the git is not recognized as internal or external command error. It may also say operable program or batch file. It might sound confusing, at first. However, this is a fairly common error with a very easy solution.

    How To Fix Git Is Not Recognized As Internal Or External Command

    First, identify where Git is installed on your system.

    This is the folder specified when you were installing it from the official Git installer file.

    By default it can be somewhere in your Program Files directory. For this example, to keep things simple, we will assume you installed Git into C:\Git directory.

    To fix git is not recognized as internal or external command, operable program or batch file, follow these steps:

    Now for visual speed-learners, let's go over each step in detail:

    Click Start button.

    This one's easy. Just click on Start button from your Windows desktop.

    Start typing "environment variables", and press Enter.

    First, click on Start button and start typing "environment variables."

    add path to environment variables

    You don't even have to finish typing the complete phrase.

    Just press Enter or Open button.

    Click on Environment Variables button, close to lower right corner.

    On this System Properties window that opens, click Environment Variables... button:

    how to find environment variables

    This leads us to the next step.

    Click anywhere in lower box that says System Variables.

    There are two main types of Environment Variables.

    They are displayed on two separate lists on this window:

    user and system variables

    Both lists have the path variable on them. So how do we know which one to choose?

    The upper box is user variables. Add your git path in this box, if you want git to be available on the command line from any hard drive location, even C:\, and not just the folder where git was installed. The idea behind user variables is that only the currently logged in Windows user's system configuration will be affected.

    The lower box is called system variables. Adding git to path here, will end up applying it systemwide. Regardless who is logged in, Windows will recognize git command anywhere on the command line.

    I personally use system variables, because nobody else is using my computer anyway.

    Scroll down until you see Path variable, and click on it once.

    Choose your list, and scroll down to find Path variable.

    Click on the Path variable just one time to select it.

    Click on Edit button to start editing Path variable.

    Then click Edit button just underneath the list.

    Now this new window should open that looks like this:

    adding python to PATH environment variable

    The Path variable contains multiple entries for all kinds of other programs.

    This is the list to which we need to add the path to the folder where our git is installed.

    In other words, the directory where the executable file git.exe is located.

    Click New button to start a new blank variable.

    Now, click on New button to add a new Environment Variable:

    how to add new environment variable

    Type the location of your Git installation into this new input box at the bottom.

    Edit environment variables
    โœ•
    C:\Program Files\Git\bin
    C:\Windows\System32\
    C:\Windows\
    C:\Program Files\Java\jdk_version\bin
    C:\Program Files (x86)\Java\jre_version\bin
    C:\Program Files (x86)\Java\jdk_version\bin
    C:\Program Files\Git\bin
    C:\Program Files\Git\cmd
    C:\Program Files\Git\
    C:\Program Files\Git\bin
    C:\Program Files\Git\cmd
    C:\Program Files (x86)\Git\
    C:\Program Files (x86)\Git\bin
    C:\Program Files (x86)\Git\cmd
    C:\Users\username\AppData\Local\Programs\Git\
    C:\Users\username\AppData\Local\Programs\Git\bin
    C:\Users\username\AppData\Local\Programs\Git\cmd
    C:\ProgramData\Git\
    C:\Program Files\Microsoft SQL Server\130\Tools\Binn\
    C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\
    C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\
    C:\Program Files\Microsoft SQL Server\120\Tools\Binn\
    C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\
    C:\Program Files\Microsoft SQL Server\140\Tools\Binn\
    C:\Program Files\Microsoft SQL Server\140\DTS\Binn\
    C:\Program Files\Microsoft SQL Server\130\Tools\Binn\
    C:\Program Files (x86)\Yarn\bin\
    C:\Program Files\dotnet\
    C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\
    C:\Program Files (x86)\Windows Kits\10\Microsoft Application Virtualization\Sequencer\
    C:\Program Files\Microsoft VS Code\bin
    C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code
    C:\Program Files\Amazon\AWSCLI\bin\
    C:\Users\username\AppData\Local\Programs\Microsoft VS Code\bin
    C:\Users\username\AppData\Local\Programs\Python\Python-version\Scripts\
    C:\Users\username\AppData\Local\Programs\Python\Python-version\
    C:\Users\username\AppData\Local\Yarn\bin
    C:\Program Files (x86)\Microsoft Visual Studio\version\VC\bin
    C:\Program Files\Microsoft Visual Studio\version\Common7\IDE\
    C:\Program Files\Microsoft Visual Studio\version\VC\bin
    C:\Program Files\Android\Android Studio\bin
    C:\Users\username\.dotnet\tools
    C:\Program Files\Python\Python-version\Scripts\
    C:\Program Files\Python\Python-version\
    C:\Program Files\Nodejs\
    C:\Program Files\Microsoft Network Monitor 3\
    C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\
    C:\Program Files\Microsoft\Web Platform Installer\
    C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\
    C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\
    C:\Program Files\Microsoft MPI\Bin\
    C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler
    C:\Program Files (x86)\Common Files\Intel\Shared Libraries\
    C:\Program Files\Intel\iCLS Client\
    C:\Program Files\Intel\Intel(R) Management Engine Components\DAL
    C:\Program Files\Intel\Intel(R) Management Engine Components\IPT
    C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL
    C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT
    C:\Program Files (x86)\Intel\iCLS Client\
    C:\Program Files (x86)\Intel\UCRT\
    C:\Program Files (x86)\Intel\OpenCL SDK\6.1\bin\x86
    C:\Program Files (x86)\Intel\OpenCL SDK\6.1\bin\x64
    C:\Program Files (x86)\Common Files\Oracle\Java\javapath
    C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
    C:\Program Files\NVIDIA Corporation\NVIDIA NGX
    C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR
    C:\ProgramData\chocolatey\bin
    C:\Program Files\Calibre2\
    C:\Program Files (x86)\Gpg4win\..\GnuPG\bin
    C:\Program Files\Git\mingw64\bin
    C:\Program Files\Git\usr\bin
    C:\Program Files (x86)\GNU\GnuPG\pub
    C:\Program Files\iTunes\
    C:\Program Files\iPod\bin\
    C:\Program Files (x86)\QuickTime\QTSystem\
    C:\Program Files\Common Files\Apple\Apple Application Support\
    C:\Program Files (x86)\Common Files\Apple\Apple Application Support\
    C:\Program Files\Common Files\Microsoft Shared\Windows Live
    C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live
    C:\Program Files\Windows Live\Shared
    C:\Program Files (x86)\Skype\Phone\
    C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static
    C:\Program Files\Microsoft SQL Server\130\Tools\Binn\
    C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\
    C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\
    C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\
    C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\
    C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies\
    C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\
    C:\Program Files\Microsoft SQL Server\120\Tools\Binn\
    C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\
    C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\
    C:\Program Files\Microsoft SQL Server\140\DTS\Binn\
    C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\
    C:\Program Files (x86)\Windows Kits\10\Microsoft Application Virtualization\Sequencer\
    C:\Program Files (x86)\Yarn\bin\
    C:\Program Files\Microsoft VS Code\bin
    C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code
    C:\Program Files\Amazon\AWSCLI\bin\
    C:\Users\username\AppData\Local\Programs\Microsoft VS Code\bin
    C:\Users\username\AppData\Local\Programs\Python\Python-version\Scripts\
    C:\Users\username\AppData\Local\Programs\Python\Python-version\
    C:\Users\username\AppData\Local\Yarn\bin
    C:\Program Files (x86)\Microsoft Visual Studio\version\VC\bin
    C:\Program Files\Microsoft Visual Studio\version\Common7\IDE\
    C:\Program Files\Microsoft Visual Studio\version\VC\bin
    C:\Program Files\Android\Android Studio\bin
    C:\Users\username\.dotnet\tools
    C:\Program Files\Python\Python-version\Scripts\
    C:\Program Files\Python\Python-version\
    C:\Program Files\Nodejs\
    C:\Program Files\Microsoft Network Monitor 3\
    C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\
    C:\Program Files\Microsoft\Web Platform Installer\
    C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\
    C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\
    C:\Program Files\Microsoft MPI\Bin\
    C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler
    C:\Program Files (x86)\Common Files\Intel\Shared Libraries\
    C:\Program Files\Intel\iCLS Client\
    C:\Program Files\Intel\Intel(R) Management Engine Components\DAL
    C:\Program Files\Intel\Intel(R) Management Engine Components\IPT
    C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL
    C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT
    C:\Program Files (x86)\Intel\iCLS Client\
    C:\Program Files (x86)\Intel\UCRT\
    C:\Program Files (x86)\Intel\OpenCL SDK\6.1\bin\x86
    C:\Program Files (x86)\Intel\OpenCL SDK\6.1\bin\x64
    C:\Program Files (x86)\Common Files\Oracle\Java\javapath
    C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
    C:\Program Files\NVIDIA Corporation\NVIDIA NGX
    C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR
    C:\ProgramData\chocolatey\bin
    C:\Program Files\Calibre2\
    C:\Program Files (x86)\Gpg4win\..\GnuPG\bin
    C:\Program Files\Git\mingw64\bin
    C:\Program Files\Git\usr\bin
    C:\Program Files (x86)\GNU\GnuPG\pub
    C:\Program Files\iTunes\
    C:\Program Files\iPod\bin\
    C:\Program Files (x86)\QuickTime\QTSystem\
    C:\Program Files\Common Files\Apple\Apple Application Support\
    C:\Program Files (x86)\Common Files\Apple\Apple Application Support\
    C:\Program Files\Common Files\Microsoft Shared\Windows Live
    C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live
    C:\Program Files\Windows Live\Shared
    C:\Program Files (x86)\Skype\Phone\
    C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static
    C:\Program Files\Microsoft SQL Server\130\Tools\Binn\
    C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\
    C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\
    C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\
    C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\
    C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies\
    C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\
    C:\Program Files\Microsoft SQL Server\120\Tools\Binn\
    C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\
    C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\
    New
    Edit
    Browse...
    Delete
    Move Up
    Move Down
    Edit text...
    OK
    Cancel

    Type path to where your Git is installed on your system.

    Simply start typing the path.

    For example: C:\Git or C:\Program Files\Git.

    Whatever the folder is where GIt was installed.

    Click Okay button 3 times in a row to exist and save your path variable.

    Press Enter to confirm your path.

    Now to exit out of all Environment Variables windows, click Okay button 3 times, until all windows disappear.

    Congratulations! At this point your git has been added to system Path using environment variables.

    Go to your cmd.exe and navigate to C:\ drive to verify if you can call git command:

    C:\>git --version
    git version 2.39.1.windows.1

    As you can see you can now call git on the command line from any hard drive location. This means other programs like VSCode, or Visual Studio, can call this command too from their own environments.

    It took hours to put this material together. Please help me out by sharing it ๐Ÿ™‚

    Click button below to share link on WhatsApp or Discord or with friends:

    Hope this helps someone ๐Ÿ™‚ Please share this page!

    Write For Us
    Sign Up Now  -  It's Free!

    How To Fix Git Is Not Recognized As An Internal Or External Command Operable Program Or Batch File Error

    Comments (2) New! (You can now post comments on articles!)

    (By posting a comment you are registering a Ghost Together account.)
    Register
    Register
    Post It
    DM Coming Soon
    f f