右键菜单添加 Open Git Bash

前言

在使用 TortoiseGit 作为Git的可视化工具,但是会经常用到命令行操作,一般来说,安装了TortoiseGit后,右键会出现 open git-bash here... 的命令。但是,可能由于某些原因,这个右键菜单选项不见了。下面就是重新添加此右键菜单的方法。

步骤、

第一步:在桌面新建文本文件,然后重命名为OpenGitBash.reg

第二步:编辑文件,复制下面的内容,并保存

csharp 复制代码
Windows Registry Editor Version 5.00
; Open files
; Default Git-Bash Location C:\Program Files\Git\git-bash.exe

[HKEY_CLASSES_ROOT\*\shell\Open Git Bash]
@="Open Git Bash"
"Icon"="C:\\Program Files\\Git\\git-bash.exe"

[HKEY_CLASSES_ROOT\*\shell\Open Git Bash\command]
@="\"C:\\Program Files\\Git\\git-bash.exe\" \"--cd=%1\""

; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear

[HKEY_CLASSES_ROOT\Directory\shell\bash]
@="Open Git Bash"
"Icon"="C:\\Program Files\\Git\\git-bash.exe"


[HKEY_CLASSES_ROOT\Directory\shell\bash\command]
@="\"C:\\Program Files\\Git\\git-bash.exe\" \"--cd=%1\""

; This will make it appear when you right click INSIDE a folder
; The "Icon" line can be removed if you don't want the icon to appear

[HKEY_CLASSES_ROOT\Directory\Background\shell\bash]
@="Open Git Bash"
"Icon"="C:\\Program Files\\Git\\git-bash.exe"

[HKEY_CLASSES_ROOT\Directory\Background\shell\bash\command]
@="\"C:\\Program Files\\Git\\git-bash.exe\" \"--cd=%v.\""

第三步:双击执行 OpenGitBash.reg

弹框1:点击是

弹窗2:点击确定

第四步:打开右键菜单,查看效果

相关推荐
Yvonne爱编码30 分钟前
简述ajax、node.js、webpack、git
前端·git·ajax·webpack·node.js·visual studio
2501_9200470314 小时前
git在Linux中的使用
linux·git·elasticsearch
小马哥编程14 小时前
DNS解析中的服务器协作机制
服务器·git·github
白帽小野1 天前
SVN和Git两种版本管理系统对比
git·svn·版本控制系统
rivercoder1 天前
Gitea:轻量级的自托管Git服务
git·gitlab·gitea
vortex51 天前
常见Bash脚本漏洞分析与防御
开发语言·bash
呜喵王阿尔萨斯1 天前
git命令解析
c++·git
谢栋_2 天前
设计模式从入门到精通之(六)策略模式
设计模式·bash·策略模式
davenian2 天前
< 自用文 OS 有关 > (续)发现正在被攻击 后的自救 Fail2ban + IPset + UFW 工作流程详解
ubuntu·bash·fail2ban·ipset
码界奇点2 天前
从零构建Linux Shell解释器深入理解Bash进程创建机制
linux·运维·解释器模式·bash·ux·源代码管理