Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

windows

I created Android Project in Android Studio, now that I would like to push it into my repository.

When I enter the following command in Android Studio terminal:

git remote add origin https://..........

The following error is returned:

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

How can I fix this?

like image 391
venugopal Avatar asked May 20 '15 14:05

venugopal


3 Answers

If "git" is not installed then you need to install git and while installation select option 'Use Git from the Windows Command Prompt'.

If "git" is installed but still you are getting "git is not recognized as an internal or external command" error then you need to set PATH variable to point to git executable. To do that follow the steps below:

  • Open My Computer, right click and select Properties
  • On this window, click on Advanced System Settings link which will open System Properties popup.
  • In that popup (under Advanced tab), click on Environment Variables which will open Environment Variables popup.
  • In that popup, select Path and click on Edit, which will open Edit Environment Variable popup Click on Edit to open Edit Environment Variable popup
  • From that popup window, click on Browse and browse to the git installation directory. Mostly it would be "C:\Program Files (x86)\Git\bin", select the directory and click Ok on all opened popups.

You will need to close command prompt and open again. Git command should work now!

like image 199
Mittal Patel Avatar answered Oct 26 '22 17:10

Mittal Patel


Most probably Git is not installed on your machine (or installed incorrectly). Open this link to download an installer. It should do the job for you.

There are also other ways to install Git on Windows.

like image 42
Nick Volynkin Avatar answered Oct 26 '22 15:10

Nick Volynkin


When you install Git, you must select the option 'run Git from the Windows command prompt'?

Download the latest version of the Git from here : http://git-scm.com/download and try again!

like image 21
pblead26 Avatar answered Oct 26 '22 16:10

pblead26