C.3. Disable context menu entries

TortoiseGit

C.3. Disable context menu entries

TortoiseGit allows you to disable (actually, hide) context menu entries. Since this is a feature which should not be used lightly but only if there is a compelling reason, there is no GUI for this and it has to be done directly in the registry. This can be used to disable certain commands for users who should not use them. But please note that only the context menu entries in the explorer are hidden, and the commands are still available through other means, e.g. the command line or even other dialogs in TortoiseGit itself!

The registry keys which hold the information on which context menus to show are HKEY_CURRENT_USER\Software\TortoiseGit\ContextMenuEntriesMaskLow and HKEY_CURRENT_USER\Software\TortoiseGit\ContextMenuEntriesMaskHigh.

Each of these registry entries is a DWORD value, with each bit corresponding to a specific menu entry. A set bit means the corresponding menu entry is deactivated.

Table C.1. Menu entries and their values

Value Menu entry
0x0000000000000002 Sync
0x0000000000000004 Commit
0x0000000000000008 Add
0x0000000000000010 Revert
0x0000000000000020 Cleanup
0x0000000000000040 Resolve
0x0000000000000080 Switch/Checkout
0x0000000000000100 Sendmail
0x0000000000000200 Export
0x0000000000000400 Create Repository here
0x0000000000000800 Branch/Tag
0x0000000000001000 Merge
0x0000000000002000 Delete
0x0000000000004000 Rename
0x0000000000008000 Submodule Update
0x0000000000010000 Diff
0x0000000000020000 Show Log
0x0000000000040000 Edit Conflicts
0x0000000000080000 Refence Browse
0x0000000000100000 Check for modifications
0x0000000000200000 Ignore
0x0000000000400000 RefLog
0x0000000000800000 Blame
0x0000000001000000 Repository Browser
0x0000000002000000 Apply Patch
0x0000000004000000 Delete (keep local)
0x0000000008000000 SVN Rebase
0x0000000010000000 SVN DCommit
0x0000000040000000 SVN Ignore
0x0000000100000000 Log of Submodule folder
0x0000000200000000 Rev Diff
0x0000000800000000 Pull
0x0000001000000000 Push
0x0000002000000000 Clone
0x0000004000000000 Tag
0x0000008000000000 Format Patch
0x0000010000000000 Import Patch
0x0000040000000000 Fetch
0x0000080000000000 Rebase
0x0000100000000000 Stash Save
0x0000200000000000 Stash Apply
0x0000400000000000 Stash List
0x0000800000000000 Submodule Add
0x0001000000000000 Submodule Sync
0x0002000000000000 Stash Pop
0x0004000000000000 Diff two files
0x0008000000000000 Bisect
0x0080000000000000 SVN Fetch
0x0100000000000000 Revision graph
0x0200000000000000 Daemon
0x2000000000000000 Settings
0x4000000000000000 Help
0x8000000000000000 About

Example: to disable the Sendmail the Rebase and the Settings menu entries, add the values assigned to the entries like this:

  0x0000000000000100
+ 0x0000080000000000
+ 0x2000000000000000
= 0x2000080000000100

The lower DWORD value (0x00000100) must then be stored in HKEY_CURRENT_USER\Software\TortoiseGit\ContextMenuEntriesMaskLow, the higher DWORD value (0x20000800) in HKEY_CURRENT_USER\Software\TortoiseGit\ContextMenuEntriesMaskHigh.

To enable the menu entries again, simply delete the two registry keys.