Why was git installed in AppData instead of Program Files?

寵の児 提交于 2019-11-29 21:12:34

问题


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?


回答1:


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.




回答2:


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




回答3:


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, ...)




回答4:


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.



来源:https://stackoverflow.com/questions/32297340/why-was-git-installed-in-appdata-instead-of-program-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!