Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to run git from command line

I have installed GIT for Windows right now. And when I am running this into my symfony project to reinstall the vendors by

php bin/vendors install --reinstall

Then i am getting an error

git' is not recognized as internal or external command

I have set the environmental variables also as

c:/programme files/git/cmd

Now what should I do? I have tried also for environmental variables

c:/program files/git/bin

but I am getting the same error

like image 286
Rohitashv Singhal Avatar asked Jul 30 '12 11:07

Rohitashv Singhal


People also ask

How do I run Git from cmd?

To install Git, navigate to your command prompt shell and run the following command: sudo dnf install git-all . Once the command output has completed, you can verify the installation by typing: git version .

Why is my Git not working?

A Git command needs to be run on a specific repository, so this error typically occurs when a Git command is run in a directory that Git doesn't know about. In these cases, the fix is to make sure that you are both working in the correct folder and that you set up your repository right.

Why does my terminal not recognize Git?

If the Git path is not configured correctly, you could also receive the error “git is not recognized as an internal or external command, operable program or batch file”. You can try reinstalling Git for Windows to set the path automatically.

How do I access GitHub from cmd?

Open a command prompt. To launch GitHub Desktop to the last opened repository, type github . To launch GitHub Desktop for a particular repository, type github followed by the path to the repository. You can also change to your repository path and then type github . to open that repository.


2 Answers

Two possible solutions:

  • My PATH has backslashes instead of forward ones.
  • your first line contains a typo, should be c:\program files\git\cmd

One more: If your path includes spaces, enclose it in quotes:

set PATH=%PATH%;"C:\Program Files\Git\cmd"
like image 94
eckes Avatar answered Sep 25 '22 07:09

eckes


During Git installation, in the path environment settings chose the following one. Even I had the same problem, of git not executed on my normal Command Line, but i just reinstalled it with the setting "Run Git from the Windows Command Prompt"

enter image description here

like image 40
axel Avatar answered Sep 22 '22 07:09

axel