Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 使用Windows PowerShell设置.SSH密钥时出错_Git_Powershell_Ssh_Ssh Keys - Fatal编程技术网

Git 使用Windows PowerShell设置.SSH密钥时出错

Git 使用Windows PowerShell设置.SSH密钥时出错,git,powershell,ssh,ssh-keys,Git,Powershell,Ssh,Ssh Keys,我已经让GIT BASH shell使用SSH密钥正常工作,因此我知道我的基本配置步骤是正确的,但我更喜欢windows powershell(实际上我更喜欢Mac或Linux终端,但没有可用的选项…) 无论如何 我的windows powershell是在这篇博文中用PS1脚本fount设置的 据我所知,启动运行正常 Starting SSH agent... SSH agent PID: 5064 但当我尝试在powershell中使用SSH或运行git命令时,仍然会提示输入密码。以前有人

我已经让GIT BASH shell使用SSH密钥正常工作,因此我知道我的基本配置步骤是正确的,但我更喜欢windows powershell(实际上我更喜欢Mac或Linux终端,但没有可用的选项…)

无论如何

我的windows powershell是在这篇博文中用PS1脚本fount设置的 据我所知,启动运行正常

Starting SSH agent...
SSH agent PID: 5064
但当我尝试在powershell中使用SSH或运行git命令时,仍然会提示输入密码。以前有人见过这个吗?我更喜欢PS而不是Git Bash,但在最坏的情况下,我会坚持使用它

编辑-VonC提供的答案=将%HOME%添加到windows系统环境变量

To view or change environment variables:

Right-click My Computer, and then click Properties.
Click the Advanced tab.
Click Environment variables.
Click one the following options, under user variables:
    Click New 
         variable name `HOME` (No quotes, or percentage signs) 
         value: C:\Documents and Settings\**your username**
            or: C:\Users\**your username** 

重新启动powershell(或您喜欢的任何shell),默认情况下SSH工作。

要检查的第一个元素是环境变量
%HOME%

它可能在bash会话中自然设置,但在Windows(此处为PowerShell)会话中,默认情况下不定义它

最好在“用户环境变量”级别定义该变量,以便所有shell都从中继承