我将Powershell设置为通过Git for Windows使用posh-git。在我的配置文件中,我有以下内容:
# If Posh-Git environment is defined, load it.
. (Resolve-Path "$env:LOCALAPPDATA\GitHub\shell.ps1")
. $env:github_posh_git\profile.example.ps1每次我打开Powershell时,它都会请求我的id_rsa密钥的密码。这很好,但实际显示请求所需的时间越来越长。当我第一次以这种方式设置它时,它提示pass非常快,但加载时间随着时间的推移而增加。
有什么建议吗?我甚至不知道从什么开始调查这件事。
发布于 2013-06-05 19:42:19
问题确实在于用户环境变量的设置速度很慢。我最近合并了使用临时文件的a change。
最新的GH4W (1.0.48.0)包括此更改。
发布于 2013-06-03 17:32:51
我将这个问题追溯到这个:https://superuser.com/questions/565771/setting-user-environment-variables-is-very-slow
因为chrome有很多进程需要时间来响应,所以我简单地在我的profile.ps1中关闭了Chrome,如下所示。
$agent = Get-Process -Name ssh-agent -ErrorAction SilentlyContinue
$chrome = Get-Process -Name chrome -ErrorAction SilentlyContinue
$chromepath = $null
if(!$agent -and $chrome){
Write-Host "Chrome is open, press any key to close"
$host.UI.RawUI.ReadKey() | out-null
$chromepath = $chrome[0].Path
$chrome | Stop-Process
}
Start-SshAgent -Quiet
if($chromepath){
Start-Process $chromepath
}发布于 2013-05-13 00:46:19
我也遇到过类似的问题(没有密码请求)。重新安装有帮助。这是给here的建议
Eiter的方式,今天我完全删除了所有的posh-git痕迹(包括Microsoft.PowerShell_profile.ps1中的条目),并从源代码克隆了它。这为我解决了问题!
https://stackoverflow.com/questions/16507054
复制相似问题