Git: Command not found Windows

8

3

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"?

barntothemax

Posted 2013-03-20T14:49:56.853

Reputation: 199

1Could you post your windowd PATH? – None – 2013-03-20T14:51:26.427

1Sorry, you'll have to explain. – None – 2013-03-20T14:52:53.060

1When 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 – 2013-03-20T15:11:02.133

Answers

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.

LaGrandMere

Posted 2013-03-20T14:49:56.853

Reputation: 231

1This 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. – Ben Racicot – 2013-10-01T23:33:28.293

@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 – 2013-10-02T07:01:28.263

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.

Don Branson

Posted 2013-03-20T14:49:56.853

Reputation: 160

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"

Marius Matioc

Posted 2013-03-20T14:49:56.853

Reputation: 101

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!

stegosawr

Posted 2013-03-20T14:49:56.853

Reputation: 1