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

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

相关推荐
sunny_liangzilong42 分钟前
为何 git 默认是 master分支,而github默认是main分支(DeepSeek问答)
git·github
yangshuo12812 小时前
git安装flutter
git·flutter
vortex52 小时前
Shell基础:中括号的使用
linux·运维·bash·shell
16年上任的CTO3 小时前
git基础使用--4---git分支和使用
git·gitee·git分支
16年上任的CTO3 小时前
git基础使用--1--版本控制的基本概念
git·gitee·版本控制
wdxylb6 小时前
GIt使用笔记大全
笔记·git·elasticsearch
maply18 小时前
VSCode 中的 Git Graph扩展使用详解
ide·git·vscode·编辑器·扩展
行十万里人生1 天前
Qt事件处理:理解处理器、过滤器与事件系统
开发语言·git·qt·华为od·华为·华为云·harmonyos
会敲代码的Steve1 天前
git笔记-简单入门
笔记·git
画船听雨眠aa1 天前
gitlab云服务器配置
服务器·git·elasticsearch·gitlab