最近装了个vs 2017 的社区版的,发现之前安装的git的右键快捷方式不见了,因此在此写备注,只要是git的安装位置是默认位置的,也可以使用此注册表恢复,其他路径请自行修改reg文件
主要是针对git 2.x以后的,
由于windows注册表只支持ascii编码,所以下面内容需要通过记事本另存为ASCII编码后执行,如果是其他如utf-8编码保存的,会呈现乱码
git 新版本(2.10.x以后)
git-all-in-one.reg
从上往下依次是
HKEY_CLASSES_ROOT\Directory\shell\
, 设置选中文件夹时右键打开的快捷方式HKEY_CLASSES_ROOT\Directory\Background\shell\
, 设置在文件夹里面空白处右键的快捷方式
其他软件的右键快捷方式也可以如此添加,执行regedit命令找到上述路径参考下面填写即可即可。
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\git_bash]
@="通过 Git Bash 打开"
"Icon"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,5c,00,47,00,69,00,74,00,5c,00,67,00,69,00,\
74,00,2d,00,62,00,61,00,73,00,68,00,2e,00,65,00,78,00,65,00,00,00
[HKEY_CLASSES_ROOT\Directory\shell\git_bash\command]
@="\"C:\\Program Files\\Git\\git-bash.exe\""
[HKEY_CLASSES_ROOT\Directory\shell\git_gui]
"Icon"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,5c,00,47,00,69,00,74,00,5c,00,63,00,6d,00,\
64,00,5c,00,67,00,69,00,74,00,2d,00,67,00,75,00,69,00,2e,00,65,00,78,00,65,\
00,00,00
@="通过 Git GUI打开"
[HKEY_CLASSES_ROOT\Directory\shell\git_gui\command]
@="\"C:\\Program Files\\Git\\cmd\\git-gui.exe\" \"--working-dir\" \"%V\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\git_bash]
@="通过 Git Bash 打开"
"Icon"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,5c,00,47,00,69,00,74,00,5c,00,67,00,69,00,\
74,00,2d,00,62,00,61,00,73,00,68,00,2e,00,65,00,78,00,65,00,00,00
[HKEY_CLASSES_ROOT\Directory\Background\shell\git_bash\command]
@="\"C:\\Program Files\\Git\\git-bash.exe\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\git_gui]
@="通过 Git GUI打开"
"Icon"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,5c,00,47,00,69,00,74,00,5c,00,63,00,6d,00,\
64,00,5c,00,67,00,69,00,74,00,2d,00,67,00,75,00,69,00,2e,00,65,00,78,00,65,\
00,00,00
[HKEY_CLASSES_ROOT\Directory\Background\shell\git_gui\command]
@="\"C:\\Program Files\\Git\\cmd\\git-gui.exe\" \"--working-dir\" \"%V\""
这个是 git2.x以前的,仅供参考
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\git_gui]
@="Git &GUI Here"
[HKEY_CLASSES_ROOT\Directory\shell\git_gui\command]
@="\"C:\\Program Files (x86)\\Git\\bin\\wish.exe\" \"C:\\Program Files (x86)\\Git\\libexec\\git-core\\git-gui\" \"--working-dir\" \"%v\""
[HKEY_CLASSES_ROOT\Directory\shell\git_shell]
@="Git Ba&sh Here"
[HKEY_CLASSES_ROOT\Directory\shell\git_shell\command]
@="\"C:\\Windows\\SysWoW64\\wscript\" \"C:\\Program Files (x86)\\Git\\Git Bash.vbs\" \"%v\""