右键菜单添加 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:点击确定

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

相关推荐
爱莉希雅&&&8 小时前
shell编程之awk命令详解
linux·服务器·git
笑稀了的野生俊8 小时前
在服务器中下载 HuggingFace 模型:终极指南
linux·服务器·python·bash·gpu算力
baiyu338 小时前
成为git砖家(12): 看懂git合并分支时冲突提示符
git
wu_aceo12 小时前
将本地项目提交到Gitee
git·gitee·提交·本地提交·上传git
随便取个六字1 天前
GIT操作 学习
git·学习
weixin_307779131 天前
Hive集群之间迁移的Linux Shell脚本
大数据·linux·hive·bash·迁移学习
星源~1 天前
tree 命令集成到 Git Bash:可视化目录结构的指南
git·单片机·物联网·嵌入式·项目开发
shimly1234561 天前
bash 脚本比较 100 个程序运行时间,精确到毫秒,脚本
开发语言·chrome·bash
zhaqonianzhu1 天前
git gerrit安装钩子
git·gerrit
这是个栗子1 天前
【问题解决】VSCode终端中看不到Git-Bash
ide·git·vscode