Cannot find command 'git' - windows
Asked Answered
C

5

30

I am trying to install mongodb_engine with my python django application, however I am getting this error

Cannot find command 'git'

I am trying this command from mongodb documentation. http://django-mongodb-engine.readthedocs.org/en/latest/topics/setup.html

pip install git+https://github.com/django-nonrel/[email protected]

I believe git here is causing the problem since the project is stored in git repo. Is there a way to install git to run this pip command? I tried multiple sources but wasn't able to get it to work.

Compossible answered 10/4, 2015 at 15:55 Comment(1)
I am facing the same problem. Were you able to resolve it? Did you install 'git' ? Where did you install it from? Can you please tell me the whole thing you did. Thanks a lot.Chryso
C
24

Download and Install git in your windows from here:

https://git-scm.com/download/win

Then add its installation bin path to your windows's environment path. Then you will find the git command at the command prompt globally.

This may solve you problem.

How to change environment variables : Git: Installing Git in PATH with GitHub client for Windows

For Visual studio code restart after adding the environment variables

Claritaclarity answered 10/4, 2015 at 16:2 Comment(1)
Where to install the git from? I see a lot of git program online. I am not sure which one to install. Can you please tell me?Chryso
C
52

If your using Anacoda, then you can try this

conda install git
Calico answered 31/3, 2018 at 14:26 Comment(2)
You're correct!Junk
You'll also need to add the installed directory to your PATH. In my case, that was $User\Anaconda3\Library\bin\Ashlieashlin
C
24

Download and Install git in your windows from here:

https://git-scm.com/download/win

Then add its installation bin path to your windows's environment path. Then you will find the git command at the command prompt globally.

This may solve you problem.

How to change environment variables : Git: Installing Git in PATH with GitHub client for Windows

For Visual studio code restart after adding the environment variables

Claritaclarity answered 10/4, 2015 at 16:2 Comment(1)
Where to install the git from? I see a lot of git program online. I am not sure which one to install. Can you please tell me?Chryso
B
2

Add the path of git.exe to your windows environment variable called 'path'. My git.exe is in the path of 'C:\Users\LW\AppData\Local\GitHub\PortableGit_c2ba306e536fdf878271f7fe636a147ff37326ad\bin\git.exe'. Your can find your exe file in the similar folder path.

Beaut answered 14/4, 2016 at 10:3 Comment(0)
T
0

You can install git and configure the path with the git directory in System variables path.

Thibault answered 10/1, 2020 at 1:19 Comment(2)
is it different to the highest rated accepted answer to this question?Metic
It's more like a comment then an answer. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers according to guideTallu
L
0

Step-1: Install git https://git-scm.com/download/win

Step-2: While installing "Check Add Git to Path" so that can be accessed via CMD.

Step-3: If in case, you've missed the step - 2, then makesure that your environment variable list has the following:

enter image description here

It should be done by now.

Law answered 6/7 at 7:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.