Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.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
如何更新posh git_Git_Powershell_Posh Git - Fatal编程技术网

如何更新posh git

如何更新posh git,git,powershell,posh-git,Git,Powershell,Posh Git,我想更新一个旧版本的posh git(同时尝试解决powershell启动缓慢的问题) 我从repo中获取了最新信息,当我尝试执行\install.ps1时 It seems posh-git is already installed... 如何更新posh git?它所做的只是查看脚本是否来源于您的个人资料: $profileLine = ". '$installDir\profile.example.ps1'" if(Select-String -Path $PROFILE -Patter

我想更新一个旧版本的posh git(同时尝试解决powershell启动缓慢的问题)

我从repo中获取了最新信息,当我尝试执行
\install.ps1

It seems posh-git is already installed...

如何更新posh git?

它所做的只是查看脚本是否来源于您的个人资料:

$profileLine = ". '$installDir\profile.example.ps1'"
if(Select-String -Path $PROFILE -Pattern $profileLine -Quiet -SimpleMatch) {
    Write-Host "It seems posh-git is already installed..."
    return
}
由于installDir似乎是您运行安装脚本的文件夹,因此仅使用较新版本的posh git升级该文件夹应该已经更新了文件


如果您对此不满意,只需删除配置文件中源于
配置文件的行。例如.ps1
,然后再次运行安装:)

我已通过PsGet安装,因此我重命名了该文件夹

C:\Users\[myName]\Documents\WindowsPowerShell\Modules\posh git

然后重新运行

安装模块posh git


它下载了最新版本,但告诉我它已经安装,可能是因为我没有从Microsoft.PowerShell\u profile.ps1中删除这些行。不过,这就是我所需要的。

如果通过PsGet安装,您只需运行

Update-Module posh-git

更好的是,没有讨厌的卸载脚本。。工作顺利,谢谢:)