首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Windows 10无法识别Git

Windows 10无法识别Git
EN

Stack Overflow用户
提问于 2015-12-09 18:05:32
回答 2查看 2K关注 0票数 2

我已经在我的笔记本电脑上安装了Windows10 x64,然后使用最新的Git (Git-2.6.3-64-bit)。正如我在笔记本电脑上看到的,Git现在安装在这个目录:C:\Users\MyPC\AppData\Local\Programs\Git (我没有机会指定另一个特定的文件夹,因为它是在Git安装期间自动完成的)。已经选择了“从Windows提示符使用Git”和"Use OpenSSH“选项,使用Git更新窗口路径。毕竟,问题在于,Windows无法识别Git在哪里调用。我尝试过git --version,但它在Windows中是无法识别的。

我的问题是(在Windows10Pro x64上):

  1. 我们可以为Git指定另一个安装文件夹吗?
  2. 在Git /bin中,没有ssh.exe,而在OpenSSH选择对话框中,它告诉我“这使用Git附带的ssh.exe”。那它在哪里,那个建好的SSH客户?
  3. 我怀疑现在Windows 10不接受安装在%USERPROFILE%/AppData上的任何外部程序被包含到系统路径中。这是正确的吗?
  4. 如何使Windows“看到”Git?
EN

回答 2

Stack Overflow用户

发布于 2019-06-14 16:25:11

这是一次非常令人沮丧的旅程,但对我来说,下面这段旅程让我开始了:

  1. 确保c:\ Windows \System32 32\OpenSSH\在您的路径变量中(我知道Windows应该自己看到这一点)
  2. 转到C:\Users\<>.gitconfig,编辑您的全局git配置文件,指向正确的ssh.exe‘C:/ssh.exe/System32 32/OpenSSH
  3. 如果您还没有生成SSH密钥,请确保您的id_rsa.ppk文件位于C:\Users\<>.ssh中,并确保它在此文件夹中结束
  4. 还可以检查Windows中是否启动了OpenSSH身份验证代理
票数 1
EN

Stack Overflow用户

发布于 2015-12-09 18:14:12

  1. 我们可以为Git指定另一个安装文件夹吗?

尝试以管理员身份运行安装程序,以便将其安装到Program中。我不知道如何指定自定义路径。

  1. 在Git /bin中,没有ssh.exe,而在OpenSSH选择对话框中,它告诉我“这使用Git附带的ssh.exe”。那它在哪里,那个建好的SSH客户?

一些人告诉我,它可能存在于Git安装中的.ssh文件夹中,所以C:\Users\MyPC\AppData\Local\Programs\Git\.ssh

  1. 我怀疑现在Windows 10不接受安装在%USERPROFILE%/AppData上的任何外部程序被包含到系统路径中。这是正确的吗?

AFAIK您可以添加任何目录到您的路径。

  1. 如何使Windows“看到”Git?

C:\Users\MyPC\AppData\Local\Programs\Git添加到您的路径:

代码语言:javascript
运行
复制
Start the System Control Panel applet (Start - Settings - Control Panel - System).
Select the Advanced tab.
Click the Environment Variables button.
Under System Variables, select Path, then click Edit.
You'll see a list of folders, as this example for my system shows: C:\Program Files\Windows Resource Kits\Tools\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Support Tools\;C:\Program Files\Common Files\Roxio Shared\DLLShared;C:\Program Files\Common Files\Ulead Systems\MPEG;C:\Program Files\Intel\DMIX;C:\Program Files\Executive Software\Diskeeper\;C:\Program Files\Bonjour\;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Misc
You can add additional folders that you want to include in searches. I add a "C:\program files\misc" entry into which I place my standalone utilities, instead of copying them into C:\windows. Click OK.
You'll need to restart the processes (e.g., command prompt) that use the system path to see the added folders.

来自http://windowsitpro.com/systems-management/how-can-i-add-new-folder-my-system-path

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34185901

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档