配置Powershell 使其支持git_for_windows 并添加到右键菜单
与hyf一起折腾一晚终于搞定。
1.
更改Powershell配置,使其支持 git. 工具为 Posh-Git参考Pro git (git官网可下载)
=============================================================================
If you’ve installed GitHub for Windows, Posh-Git is included by default, and
all you have to do is add these lines to your profile.ps1 (which is usually located
in C:\Users\<username>\Documents\WindowsPowerShell):
. (Resolve-Path "$env:LOCALAPPDATA\GitHub\shell.ps1")
. $env:github_posh_git\profile.example.ps1
!profile.ps1 在Power shell.exe 所在文件夹 新建该文件
!profile.ps1 无数字证书,需修改策略,运行命令 set-executionpolicy remotesigned
2.更改注册表
在 文件夹空白处右键打开 git shell
=============================================
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\directory\Background\shell\git_shell]
@="Git Shell Here"
[HKEY_CLASSES_ROOT\directory\Background\shell\git_shell\command]
@="\"C:\Windows\syswow64\Windowspowershell\v1.0\powershell.exe\""
==============================================