github自带的git shell
自从用了git shell就习惯了它方便的查看项目的各种状态,现在项目基本都用VScode开发,里面的终端可以指定使用Powershell为了方便就找了下如何让Powershell用上git ,在此记录一下!
项目 posh-git : https://github.com/dahlbyk/posh-git
1、安装 (PowerShell version 5 以上)
Install-module
//没有安装Nuget 会自动提示安装,输入 y即可
//也可以手动安装
Install-PackageProvider NuGet -Force
Import-PackageProvider NuGet -Force//更新
Update-Module posh-git
2、安装完在C:\Users\\Documents\WindowsPowerShell 添加文件profile.ps1
Import-Module posh-git
//可选命令
$ GitPromptSettings.DefaultPromptSuffix = ‘`n (′′>′′∗( nestedPromptLevel + 1)) ‘
更多命令可以看这里