9

I have downloaded and installed GIT from http://git-scm.com/download/win

For some reason, in Cygwin and in Command prompt (Windows 8), the git command is not found.

I selected the option for Windows explorer integration and the "GIT GUI/ repo here" option appears when I right click in file explorer.

Can anyone explain why typing "git -v" or "git --version" gives a "command not found"?

  • 1
    Could you post your windowd PATH? – poiuytrez Mar 20 '13 at 14:51
  • 1
    Sorry, you'll have to explain. – Barney Mar 20 '13 at 14:52
  • 1
    When clicking through the installer, one of its pages is about how much of Git programs make available to you by modifying the system PATH env. variable. For unknown reason it defaults to "none", and normally you should tick the option to provide access to Git commands only (the middle one as it appears on that page). – kostix Mar 20 '13 at 15:11
10

You need to have C:\Program Files\Git\cmd in your path. Make sure it is there, start a new cmd prompt, type git --version.

  • 2
    This still gives me the 'command not found' error. However git's bash works by itself. Cygwin doesn't seem to want to work with Git. – TR3B Oct 1 '13 at 23:33
  • @BenRacicot In this case, as Don said in his post, rerun the cygwin setup.exe installer, and you should be able to install git in cygwin. – LaGrandMere Oct 2 '13 at 7:01
6

As LaGrandMere explained, it's because git is not in your path. Instead of downloading and installing git, an easier alternative might be to run the cygwin setup.exe, and select git there. It will go into a directory that's already in your path (/usr/bin) and you will be able to run it from a bash prompt.

The one you installed works with the explorer, but that doesn't require the command to be in the path.

0

The git bash PATH is different from the Windows PATH. You need to add the the bash path (in .bashrc) "/c/Progam Files/git/bin"

0

For me using Windows 10 the Git/cmd/ folder is located in %USERPROFILE%\Appdata\Local\Programs\Git\cmd

Adding that to the Path Variable in the List "System Vairables" worked.

You need to restart your cmd. Then you should be able to execute the following command git --version.

If you're working with a IDE then you maybe have to restart that too!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.