cmd中ping命令无效 怎样在cmd和powershell中使用git命令?
怎样在cmd和powershell中使用git命令?参考页:http://thepracticalsysadmin.com/setting-up-git-in-windows/ https://git
怎样在cmd和powershell中使用git命令?
参考页:http://thepracticalsysadmin.com/setting-up-git-in-windows/
https://github.com/dahlbyk/posh-git
如果您已经安装了psget,请运行以下命令:
install module posh git
您也可以手动安装它:
确认您的PowerShell高于2.0、3.0或更高版本,您可以使用以下命令进行检查:
$PSVersionTable.PSVersion版本
确认脚本的执行策略是允许的(remotesignated或unrestricted)。查看当前策略和设置策略的命令如下:
get executionpolicy
set executionpolicy remotesignated-scope currentuser-Confirm
确保git可以在shell中运行。如果提示“找不到命令”,则需要将%programfiles(x86)%gitCMD(如果仍使用32位操作系统,则路径为%programfiles%gitCMD)添加到环境变量的路径中。
将post git复制到您的计算机,然后在post git文件夹安装.ps1就这样。