首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何添加"open git-bash here...“windows资源管理器的上下文菜单?

如何添加"open git-bash here...“windows资源管理器的上下文菜单?
EN

Stack Overflow用户
提问于 2014-06-24 20:28:25
回答 8查看 159K关注 0票数 185

如何向windows资源管理器添加上下文菜单(也称为右键单击),当单击该菜单时,会打开当前资源管理器文件夹中的git-bash控制台?

EN

回答 8

Stack Overflow用户

发布于 2017-04-25 03:55:42

以下是直接从Windows installer -Git GUI为Git GUI和Git Bash导出的注册表导出(*.reg文件):

代码语言:javascript
运行
复制
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.\""

Git bash:

代码语言:javascript
运行
复制
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文件的详细信息,请参阅微软的“How to add, modify, or delete registry subkeys and values by using a .reg file”。

票数 22
EN

Stack Overflow用户

发布于 2017-03-16 07:49:00

对我来说起作用的几乎是这样,但使用以下REGEDIT路径:

HKEY_LOCAL_MACHINE/SOFTWARE/Classes/Directory/background/shell,在这里我创建了key Bash,使用我想要的显示名称的值,然后在这个命名命令下创建了另一个键,值作为git-bash.exe的路径

我在Windows10上安装了一个新的git,由于某些原因没有自动添加(git版本2.12.0 64位)

票数 7
EN

Stack Overflow用户

发布于 2018-03-02 17:47:42

在将“用Ruby启动命令提示符”添加到上下文菜单时遇到了类似的问题,因为它涉及到随cmd补丁一起传递参数。遵循与solution above类似的过程

代码语言:javascript
运行
复制
Windows Registry Editor Version 5.00 

[HKEY_CLASSES_ROOT\*\shell\Cmd With Ruby]  
@="Cmd With Ruby"  
"Icon"="C:\\Windows\\System32\\cmd.exe"

[HKEY_CLASSES_ROOT\*\shell\Cmd With Ruby\command]
@="\"C:\\Windows\\System32\\cmd.exe\" \"/E:ON /K
\"C:\\Ruby25-x64\\bin\\setrbvars.cmd\"\" \"--cd=%1\"\""


[HKEY_CLASSES_ROOT\Directory\shell\bash]  
@="Cmd With Ruby"  
"Icon"="C:\\Windows\\System32\\cmd.exe"


[HKEY_CLASSES_ROOT\Directory\shell\bash\command]
@="\"C:\\Windows\\System32\\cmd.exe\" \"/E:ON /K
\"C:\\Ruby25-x64\\bin\\setrbvars.cmd\"\" \"--cd=%1\"\"" 

[HKEY_CLASSES_ROOT\Directory\Background\shell\bash]  
@="Cmd With Ruby"  
"Icon"="C:\\Windows\\System32\\cmd.exe"


[HKEY_CLASSES_ROOT\Directory\Background\shell\bash\command]
@="\"C:\\Windows\\System32\\cmd.exe\" \"/E:ON /K
\"C:\\Ruby25-x64\\bin\\setrbvars.cmd\"\" \"--cd=%v.\"\""
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24386657

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档