1. 程式人生 > >git 刪除右鍵選單項

git 刪除右鍵選單項

問題提出

安裝完mysysgit之後,會發現在系統(此指windows)的右鍵選單中會多出Git的三個選項:Git Init Here 、Git Gui 和Git Bash。

如果你用不著上述三個命令,或者也跟我一樣覺著很長的右鍵選單覺著不爽,那你可以按照以下的方法移除右鍵選單的Git命令

解決

刪除msGit右鍵選單
在Git安裝根目錄的git-cheetah目錄下,存放了Git右鍵選單的註冊檔案

Git右鍵選單的註冊檔案
如果是windows 64位系統是git_shell_ext64.dll 檔案,如果是windows 32位系統則是git_shell_ext.dll 檔案。
那麼我們只需要使用regsvr32

(windows註冊/解除安裝元件)將其解除安裝即可
如果是windows 64位系統
cmd進入”git-cheetah”目錄,執行

regsvr32 /u git_shell_ext64.dll

如果是windows32位系統

regsvr32 /u git_shell_ext.dll

即可登出右鍵選單。
如果需要恢復那麼只需要重新註冊元件即可
但全都給清除了也不方便每次要開始選單中找一下,那我們就再在右鍵選單中新增Git Bash登錄檔如下
如果是windows 64位系統

Windows Registry Editor Version 5.00
;新增Git Bash(&
Q)右鍵選單 [HKEY_CLASSES_ROOT\Directory\Background\shell\open in git] @="Git Bash(&Q)" [HKEY_CLASSES_ROOT\Directory\Background\shell\open in git\command] @="C:\\Windows\\SysWOW64\\cmd.exe /c \"\D:\\SoftwareEngineer\\Git\\bin\\sh.exe\" --login -i\""

如果是windows 32位系統

Windows Registry Editor Version 5.00
;新增Git Bash(&
Q)右鍵選單 [HKEY_CLASSES_ROOT\Directory\Background\shell\open in git] @="Git Bash(&Q)" [HKEY_CLASSES_ROOT\Directory\Background\shell\open in git\command] @="C:\\Windows\\system32\\cmd.exe /c\"\D:\\SoftwareEngineer\\Git\\bin\\sh.exe\" --login -i\""