您的位置:首页 > 运维架构 > Shell

配置Powershell 使其支持git_for_windows 并添加到右键菜单

2015-05-17 23:10 411 查看
配置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\""

==============================================
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: