我想使用cmder powershell工具来使用git。
错误信息
Cmder提示以下错误信息:
缺少git支持,请通过'Install-Module posh-git'安装posh-git并重新启动cmder。
如果我运行Install-Module posh-git
,cmder会打印出下一个错误:
- Install-Module <<<< posh-git
- CategoryInfo : ObjectNotFound: (Install-Module:String) [], CommandNotFoundException
- FullyQualifiedErrorId : CommandNotFoundException
我已尝试的方法
- 已安装“Git for Windows”
- 将
cmder/vendor/git-for-windows
中的文件替换为从“Git for Windows”安装的文件 - 尝试来自git not properly setup in v1.2 #513和Path issues on startup #487的解决方法
- 手动安装了posh-git
问题
我的git命令可以使用,但是没有显示我正在使用的分支。
那么我应该如何解决这个问题?
Install-Module
需要3.0或更高版本。 - Ryan BemroseInstall-Module
需要Powershell 3.0或安装了PSGet
。但是,手动安装应该可以解决问题。请验证文件posh-git.psm1
是否位于$env:PSModulePath
中的某个位置。 - Ryan Bemroseinstall.ps1
后尝试重新启动 PowerShell。然后运行Import-Module posh-git
。 - Ryan Bemrose