如何更新posh-git [英] How to update posh-git

查看:288
本文介绍了如何更新posh-git的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个老版本的posh-git,我想要更新(尝试解决速度慢的PowerShell初始化问题)。

I have an old version of posh-git that I want to update (while trying to solve slow powershell start ups)

我从回购当我试图做 .\install.ps1 我得到

I've pulls latest from the repo and when I am trying to do .\install.ps1 I get

It seems posh-git is already installed...

如何更新posh-git?

How do I update posh-git?

推荐答案



All it does is look if the script is being sourced in your profile:

$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升级文件夹应该已经更新文件。

Since it seems to have the installDir as the folder from which you run the install script, merely upgrading the folder with the newer version of posh-git should give have updated the files already.

如果你不是c不幸的是,只需在配置文件中移除源代码 profile.example.ps1 的行,然后再次运行安装:)

If you are not comfortable with that, just remove the line that sources the profile.example.ps1 in your profile and run the install again :)

这篇关于如何更新posh-git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆