8

I installed the GitHub Desktop app in my Windows 7 from here and then restarted my laptop. I go to the Windows cmd and type git clone https://github.com/myName/myAwesomeProject.git and I get 'git' is not recognized as an internal or external command, operable program or batch file..

So I googled it and found out that I have to re-set the PATH from here. I go to the C>Program Files (x86) and there is no Git folder there. I dont know why. I searched for "Git" inside C and found it here C:\Users\nerd\AppData\Local\GitHub\PortableGit_c2ba306e536fdf878271f7fe636a147ff37326ad , I copied this to my PATH, restarted the laptop and clone now works.

My question is , why is Git installed in that location and not Program Files? Did I do something wrong? Will this cause problems in the future?

smci
  • 26,085
  • 16
  • 96
  • 138
slevin
  • 3,640
  • 16
  • 58
  • 106
  • 1
    So many contradicting opinions, why did they (git folks) have to make this so confusing - wasted enough time on this b.s. already !! – killjoy Jul 31 '18 at 10:56

4 Answers4

9

Install it as administrator, by right clicking on the Git package. Then it will install to the C:\Program files\Git. Otherwise it will default to the program files folder under the user folder.

RBT
  • 18,275
  • 13
  • 127
  • 181
Yeh Shenhua
  • 91
  • 1
  • 3
  • Awesome! This was the root cause for me. Earlier when I was trying to install it with my user account (which didn't have administrative privileges) then it was getting installed at path - `C:\Users\\AppData\Local\Programs\Git`. I had to call IT people to install it using an account with administrative privileges. I was on an office PC. – RBT Jul 09 '18 at 10:14
  • Thank you. For "some reason", my Git got installed on a network drive (which wouldn't usually matter except that I'm using its git-bash's vim, and it's SLOOOOW to load all its vim files from the network). This is the reason. – nomen Sep 13 '19 at 20:21
1

You should really just install the standalone Git; the Github Desktop git is meant to be internal to that app.

The Windows Git installer gives options for adding the executable paths to PATH automatically.

You can get that installer here: https://git-scm.com/download/win

nneonneo
  • 154,210
  • 32
  • 267
  • 343
0

Use the git-shell that was installed alongside the github application. You can change the default command line application in the github application (powershell, bash, cmd, ...)

Philippe Paré
  • 3,813
  • 5
  • 27
  • 50
0

Git is embedded in the GitHub Desktop application.
It has its own shell which will give you access to its git CLI.

It is best to add an independent git installation: uncompress PortableGit-2.5.0-64-bit.7z.exe anywhere you want and add it to your PATH.

VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283