Error: git not found - installing laravel with composer windows

I get an error message:

failed to clone https://github.com/php-fig/log.git, git was not found, check that it is installed and in your PATH env. 'git' is not recognized as and internal or external command, operable program or batch file 

when I try to run composer create-project laravel/laravel learning-laravel .

I installed the git GUI, which also comes with a command line shell, but I donโ€™t know why it doesnโ€™t recognize the command (I issue the create-project command at the Windows command prompt).

I also tried to run the command from the git shell, which worked, but when I tried php artisan serve , it gave me a message that the CLI stopped working.

Does anyone know how to fix git error? I would rather use the windows command shell instead of git as it can then go into my wamp / www file

+6
source share
5 answers

You need to add the directory you installed git to the PATH environment variable.

  • Right click on Computer .
  • Click "Advanced System Settings"
  • Select environment variables inside the advanced menu
  • In the System Variables section, highlight PATH
  • Add ;"C:\path\to\git\bin";"C:\path\to\git\cmd"

Check the git command on the command line to see if it worked. git is usually located in Program Files or Program Files(x86) .

+10
source

There is an easier (but temporary) way to add a path variable in Windows.

Paste this into your command line:

 SET PATH=%PATH%;C:\Program Files\Git\bin 

This will work for the rest of the command line session. Remember to install git before that.

+2
source

You need to add git to your PATH system if you want to use it on a regular command line.

Here is a guide to changing the system path in Windows:

http://www.computerhope.com/issues/ch000549.htm

+1
source

you need to remove git and reinstall (or update) the parameters you need to change from git bash, only to add git to the command line, and also after adding along your path, you can restart the computer or not need it.

0
source

I am having problems using git on Windows. I found this information and it worked for me.

http://ccn.ucla.edu/wiki/index.php/Setting_Up_and_Using_Git#Windows

0
source

Source: https://habr.com/ru/post/958709/


All Articles