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

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

相关推荐
李贺梖梖3 小时前
Git初识
git
~央千澈~3 小时前
git大文件储存机制是什么-为什么有大文件会出错并且处理大文件非常麻烦-优雅草卓伊凡
git
Komorebi_99995 小时前
Git 常用命令完整指南
大数据·git·elasticsearch
stark张宇6 小时前
Git 与 GitHub 协同工作流:从0到1搭建版本控制体系
git·gitlab·github
爱吃生蚝的于勒7 小时前
【Linux】零基础学会Linux之权限
linux·运维·服务器·数据结构·git·算法·github
minji...7 小时前
Linux相关工具vim/gcc/g++/gdb/cgdb的使用详解
linux·运维·服务器·c++·git·自动化·vim
Arva .21 小时前
开发准备之日志 git
spring boot·git·后端
奇某人1 天前
【嵌入式】【GIT】终端中文乱码修复
git
可爱的蜗牛牛1 天前
上传本地git所有历史记录到已有远程仓库
git
idaibin1 天前
"Git 多仓库用户身份自动切换与隐私保护指南
git·github