'git' is not recognized as an internal or external command

When I try to use git command on my regular windows cmd or cmd with ruby, I get the following error.

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

  • How do I automatically determine the best commit to interactively rebase from?
  • Making a web application open source
  • What does interdiff do that diff cannot?
  • Simple way of pushing repo to cdn?
  • How to fetch submodules in github
  • Making a private github's wiki public
  • How do I fix this problem?

  • Is the .git/ folder only supposed to be located in the project's root location?
  • Jenkins cannot find JUnit (Netbeans+ Git + Ant + JUnit + Jenkins)
  • Show git pull graph in other situations
  • git merge Already up to date when it is not
  • git log -S does not show anything
  • how to fix “WARNING: terminal is not fully functional” error in command console?
  • 17 Solutions collect form web for “'git' is not recognized as an internal or external command”

    Have you correctly set your PATH to point at your git installation?

    This is how you can do it:

    • right-click “My Computer”,
    • select “Properties”,
    • open “Advanced”,
    • click “Environment Variables”,
    • highlight the “Path” variable,
    • click “Edit”,
    • add your specific path to front of “Variable value” field, separated by a semicolon from the existing entry. Do not add a space between ; and last entry

    Did you open the cmd prompt before installation of git? If so, close and reopen it.

    if you have installed git for window (http://windows.github.com/) , then find git.exe in “C” drive.
    it will be something like

    C:\Users\dell\AppData\Local\GitHub\PortableGit_8810fd5c2c79c73adcc73fd0825f3b32fdb816e7\libexec\git-core

    add this to window Environment Variables as said above

    1. Go to My Computer => Local Disk(C:) => Program Files(x86) => Git => cmd
    2. Right Click the git => Select Properties
    3. Under the location Copy the text
      eg – C:\Program Files (x86)\Git\cmd
    4. Come back to the Desktop
    5. Right-click My Computer
    6. Select property
    7. Open Advanced
    8. Click Environment Variables
    9. In the System variables Find the Variable call Path
    10. Click the variable
    11. Click the Edit Button
    12. Select the Variable value Text Box .
    13. Go to the edge of the text and put semicolon(;)
    14. Then Right-click and press Paste
    15. Press Ok

    Easy route to avoid messing with PATH variables: re-install git and select “Use Git from the Windows Command Prompt”. It’ll take of the PATH variables for you as mentioned. see screenshot

    enter image description here

    If you want to setup for temporary purpose, just execute below command.

    1. open command prompt < run –> cmd >
    2. Run below command.
      set PATH=C:\Program Files\Git\bin;%PATH%
    3. Type git, it will work.

    This is valid for current window/cell only, if you will close command prompt, everything will get vanish.
    For permanently setting, set GIT in environment variable.

    a. press Window+Pause
    b. click on Advance system setting.

    c. Click on Environment variable under Advance Tab.

    d. Edit Path Variable.

    e. Add below line in end of statement.
    ;c:\Program Files\Git\bin;

    f. Press OK!!
    g. Open new command prompt .
    h. Type git and press Enter

    Thanks

    Git should be configured in your path variables.

    (on Windows 7)
    Open the start button and type in environment. Click on Edit the system environment variables. Click Environment Variables. Scroll down to the Path variable in the bottom box
    named system variables. Click edit. In the bottom box named variable value add the path to your git bin folder. (for me this is C:\Program Files (x86)\Git\bin but it can be different for you.) If there is no semicolon (;) between your path and the previous one, add one there. Make sure you don’t delete the other path variables, only add the git bin folder to the end.

    This worked for me. Git is now available through the command line.
    Open the command line and type git to verify if it worked for you.

    Start->All Programs->Git->Git Bash

    Takes you directly to the Git Shell.

    Windows 8

    1. Drag the Mouse pointer to the Right bottom corner of the screen
    2. Click on the Search icon and type: Control Panel
    3. Click on -> Control Panel -> System -> Advanced
    4. Click on Environment Variables, under System Variables, find PATH, and click on it.

    Add

    C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Git\cmd

    It worked for me

    Yo! I had lots of problems with this. It seems that Github brings its own console which you need to look for in your drive. I managed to finally run it by doing the following:

    1. Press Start.
    2. Search for “GitHub” (without quotes)
    3. Right click on “GitHub” and select “Open File Location”

    *This shall open *

    C:\Users\UserName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\GitHub, Inc
    

    Where username is your PC’s username

    1. Look for a program called “Git Shell”. Double click on it.

    This will open a PowerShell command prompt. Then you can run your git commands normally on it.

    that’s because at the time of installation you have selected the default radio button to use “git” with the “git bash” only. If you would have chosen “git and command line tool” than this would not be an issue.

    • Solution#1: as you have already installed git tool, now navigate to the desired folder and then right click and use “git bash here” to run your same command and it will run properly.
    • Solution#2: try installing again the git-scm and select the proper choice.

    Cheers 😉

    On Windows use msysgit to get a bash prompt with a git command.

    I installed Git and tried using Command prompt under actions in Team explorer/Changes.

    ;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Git\cmd
    

    add above path in environment variables

    note: path may differ but you should add both bin and cmd

    After installation, open the GitHub app and on the top right corner you’d notice a setting icon. Select Options from the dropdown and choose “Default Shell” as Cmd.

    Now try typing ‘git shell’ in the search (windows key and type) and choose Git Shell. It should open up in CMD and git should now be recognized.

    Just wanted to add to Abizern answer.
    If anyone is using a non-administrator account, you can create a “local” variable instead of a “system” variable which allows access to standard/limited accounts.

    When on the “Environmental Variables” window:

    1) Select “New…” button within the “User variables for …” section.

    2) Set the “Variable name:” as “path” and “Variable value:” as “[your-git-path]” (usually found at C:\Program Files (x86)\Git\bin).

    3) Then click OK.

    Windows 7 32 – bit

    I am using git for my Ruby on Rails application. First time so…

    I created a .bat file for loading my RoR applications with the paths manually typed using this tutorial at “http://www.youtube.com/watch?v=-eFwV8lRu1w” If you are new to Ruby on Rails you might want to check it out as I followed all steps and it works flawlessly after a few trials and errors.

    (The .bat file is editable using notepad++ hence no need for the long process whenever you need to edit a path, you can follow these simple process after creating a .bat file following the tutorials on the link above “file is called row.bat”.)

    1. right click on the .bat file,
    2. edit with notepad++.
    3. find path.
    4. insert path below the last path you inputted.

      )
      During the tutorials I don’t remember anything said in regards to using the git command so when starting a new project I had this same problem after installing git. The main issue I had was locating the folder with the bin/git.exe (git.exe did not show up in search using start menu’s “search programs and files” ) NOTE I now understood that the location might vary drastically — see below.

    To locate the bin/git.exe i followed this steps

    1 left click start menu and locate ->> all programs ->> GitHub inc.
    2 right click git shell and select open file location
    3 click through folders in the file location for the folder “bin”

    (I had 4 folders named
    1. IgnoreTemplates_fdbf2020839cde135ff9dbed7d503f8e03fa3ab4
    2. lfs-x86_0.5.1
    3. PortableGit_c2ba306e536fdf878271f7fe636a147ff37326ad (“bin/exe, found here <<-“)
    4. PoshGit_869d4c5159797755bc04749db47b166136e59132
    )

    Copy the full link by clicking on the explorers url
    (mine was “C:\Users\username\AppData\Local\GitHub\PortableGit_c2ba306e536fdf878271f7fe636a147ff37326ad\bin”) open .bat file in notepad++ and paste using instructions on how to add a path to your .bat file from tutorials above. Problem solved!

    Git Baby is a git and github fan, let's start git clone.