Adding Git to PATH Variable - Can't find GitHub under AppData/Local
我在这里遵循本指南,了解如何将
使用GitHub Client for Windows在PATH中安装Git
要引用答案,据说Git位于此处
Get the Git URL
We need to get the url of the Git \\cmd directory your computer. Git is
located here:C:\\Users\\\\AppData\\Local\\GitHub\\PortableGit_\\bin\\git.exe
我打开文件资源管理器并转到目录
在视图选项卡下,我已选中
1 | Windows can't find 'C:\\Users\\username\\AppData\\Local\\GitHub'. Check the spelling and try again. |
我正在尝试将Git添加到我的环境路径变量中,但是找不到git所在的位置。
在Git Bash中,我可以尝试在
中找到的
但是我不确定如何在环境变量下找到要放入的内容。
进行随机搜索,实际上我发现Git文件夹位于此处
1 | C:\\ProgramFiles(x86)\\Git |
但是我应该为path变量输入什么?这与其他问题的答案不同。
只需将路径添加到命令。这是添加到Windows PATH末尾的路径。
1 | C:\\Program Files\\Git\\bin\\ |
现在我们应该能够通过键入
找到
1 | git |
事实证明,Git正在偷偷摸摸!
本应安装在
我在分号后将其添加到我的Path变量中
1 | C:\\Windows\\Program Files(x86)\\Git\\bin\\git.exe |
神奇的是,我可以再次运行git。
对于使用GIT 2.7.2的Windows 7,我在环境变量下的路径中使用了它:
1 | git version 2.7.2.windows.1 |
在此地方找到另一种方法https://stackoverflow.com/a/34767523/5842689
最好的是您可以测试是否可以在cmd中工作。
" o验证,重新启动cmd,然后在cmd "
中键入git --version
它对我有用,因为在我的情况下(Win10 x64)的真实路径是
C:\\\\\\\\ Program Files(x86)\\\\\\\\ Git \\\\\\\\ bin \\\\\\\\ git.exe