突然发现自己鼠标右键没有git bash here,或者安装之后就没有git bash here。后面那种情况多半是没有默认装在C盘。我们装在其他盘的时候就需要自己去配置。git gui目前用不上,这里只讲git bash here。网上一堆教程,说法不同大多不能用要么就很繁琐。反复测试下面方法最有效。
1、win+R打开运行界面输入regedit并回车打开注册表,或者直接笔记本左下角搜索框搜索注册表。

2、按照路径打开计算机\HKEY_CLASSES_ROOT\Directory\Background\shell\, 切记是红2箭头标注的Background目录 而不是绿色箭头标注的shell目录。网上说在shell目录里面搞事的我都没搞成功。

3、进入后发现没有shell目录就新建一个,有的话就在shell上右键新建项,取名Git Bash Here ,这就是鼠标右键会显示的名字,后面不用再去配置,减少麻烦。点击Git Bash Here右键新建项取名command 如下图:

4、在红箭头表制标注的默认地方右键修改,值为你的git安装目录加上git-bash.exe。我的安装目录在下面第二张图,绿色箭头bin目录里面也有git-bash.exe,网上说配置那个的别看了,有毒,没有用就是最外面红色箭头指向的就可以。

我的安装目录是:D:\Program Files\Git\git-bash.exe。确定即可

5、点击Git Bash Here,右键新建字符串值,取名Icon,目的是为了给Git Bash Here加一个图标好看一些。修改值为安装路径D:\Program Files\Git加上\mingw64\share\git\git-for-windows.ico。每个人安装路径不一样自己找一下即可。


点击确定即可。右键你就可以看到下图你要的东西。

原文链接:https://blog.csdn.net/qq_41019529/article/details/110139830