venugopal
venugopal

Reputation: 273

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

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?

Upvotes: 7

Views: 40772

Answers (4)

NNM
NNM

Reputation: 398

Need environment variables to be defined here. I resolved the same issue for me by create three paths

enter image description here

Upvotes: 0

Mittal Patel
Mittal Patel

Reputation: 806

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!

Upvotes: 7

pblead26
pblead26

Reputation: 810

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!

Upvotes: 1

Nick Volynkin
Nick Volynkin

Reputation: 15139

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.

Upvotes: 3

Related Questions