★★# windowspowershell支持gitssh配置:★★ |
ssh-agent从 Windows 服务启动:ssh-agent从 Windows 服务启动:
键入Services的Start Menu或Win+R,然后键入services.msc启动服务窗口;
OpenSSH Authentication Agent在列表中找到并双击它;
在OpenSSH Authentication Agent Properties窗口出现,选择Automatic从Startup type:下拉菜单,然后单击Start从Service status:。确保它现在说Service status: Running。
配置Git的发出在PowerShell中的以下命令来使用Windows 10执行的OpenSSH:git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe;
通过编辑在 中config找到的文件C:\Users\%YOUR_USERNAME%\.ssh\config,将SSH 配置为在启动时自动将密钥添加到代理,并添加以下行:
Host *
AddKeysToAgent yes
IdentitiesOnly yes
如果您使用自定义名称或多个 SSH 密钥生成了 SSH 密钥,您还可以添加以下行:
Host github.com
HostName github.com
User your_user_name
IdentityFile ~/.ssh/your_file_name
ssh-agent通过发出ssh-add命令并输入您的密码将您的 SSH 密钥添加到:
ssh-add $HOME/.ssh/your_file_name
完毕!如有必要,现在重新启动 Powershell 甚至 Windows。