1、打开注册表编辑器
打开系统注册表,使用组合键"Win + R "输入"regedit"。
依次展开"HKEY_CLASSES_ROOT\Directory\Background\shell"。

2、新建右键菜单项
在[Background ]下找到"shell "如果没有则新建项shell,接着在"shell "下右键-新建项名字为"open in Git "并且修改默认值为"Git Bash Here"这个就是右键菜单显示的名字。
接着在"open in Git "下新建"字符串值 ",名字为"Icon"值为git安装目录下mingw64\share\git\的ico图标。
这一步其实就是设置右键菜单显示的小图标。


3、建立command项
接着在"open in Git "新建项"command ",并且默认值数值数据里修改git安装目录的"git-bash.exe"路径。


保存后,就可以看到右键菜单了。

添加cmd、Powershell菜单与此类似,详细参考:鼠标右键添加自定义Cmd与Powershell【最全 最详细 含图标Icon】_鼠标右键powershell-CSDN博客