如何添加一个上下文(又名右键单击)菜单到windows资源管理器,当单击时,在当前资源管理器文件夹中打开git-bash控制台?


当前回答

我在一台新的Windows 10 Pro公司笔记本电脑上安装git -2.38.1-64位时遇到了这个问题。

我尝试了几种方法……并考虑了一个regedit脚本(道德上相当于“护士-电锯!”)…但是通过简单地卸载和重新安装Git(作为“Admin”)解决了这个问题。

具体地说:

Control Panel > Programs/Features > Uninstall Git Reboot Windows Reinstall Git-2.38.1-64-bit as "Admin" Carefull check all the options, especially: "Windows Explorer Integration: Git Bash Here, Git GUI Here <= These are checked by default ... and I'm sure they were both "Y" on the initial install I copied my .gitconfig ("C:\Users\USERNAME.gitconfig") from another PC <= I don't believe this was "essential" ...but I thought I'd mention it... Browse to a local Git repo and verify the Git context menus work <= Success after reinstall!

其他回答

我在一台新的Windows 10 Pro公司笔记本电脑上安装git -2.38.1-64位时遇到了这个问题。

我尝试了几种方法……并考虑了一个regedit脚本(道德上相当于“护士-电锯!”)…但是通过简单地卸载和重新安装Git(作为“Admin”)解决了这个问题。

具体地说:

Control Panel > Programs/Features > Uninstall Git Reboot Windows Reinstall Git-2.38.1-64-bit as "Admin" Carefull check all the options, especially: "Windows Explorer Integration: Git Bash Here, Git GUI Here <= These are checked by default ... and I'm sure they were both "Y" on the initial install I copied my .gitconfig ("C:\Users\USERNAME.gitconfig") from another PC <= I don't believe this was "essential" ...but I thought I'd mention it... Browse to a local Git repo and verify the Git context menus work <= Success after reinstall!

下面是Registry导出(*。reg文件)Git GUI和Git Bash直接从Windows安装程序-Git GUI:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\git_gui]
@="Git &GUI Here"
"Icon"="C:\\Program Files\\Git\\cmd\\git-gui.exe"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\git_gui\command]
@="\"C:\\Program Files\\Git\\cmd\\git-gui.exe\" \"--working-dir\" \"%v.\""

去抨击:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\git_shell]
@="Git Ba&sh Here"
"Icon"="C:\\Program Files\\Git\\git-bash.exe"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\git_shell\command]
@="\"C:\\Program Files\\Git\\git-bash.exe\" \"--cd=%v.\""

关于*的详细信息。reg文件,请参阅微软的“如何使用.reg文件添加、修改或删除注册表子键和值”。

使用Shift + F10打开选项菜单,右键单击会出现,然后点击s到git bash这里。

当你在“https://git-scm.com/downloads”中安装git-scm时,取消位于安装窗口最底部的“只显示新选项”

一定要检查

Windows资源管理器集成 Git Bash在这里 Git GUI在这里

单击Next,您就可以开始了!

什么也不做。

只要打开你的git bash终端,输入:

                            git update-git-for-windows

一旦更新完成,这将自动添加“Git Bash here”到您的上下文菜单。

参考这个:https://stackoverflow.com/a/65467670