How to add “Open with Git Bash” and “Open with Git GUI” context menu entries in Windows

This is a just a small distraction. I’m sort of a clean freak when it comes to Windows, so I usually opt not to install things like context menu entries when I’m trying a new program. Unfortunately, I opted not to install them for Git and realized later that I really wanted them. There doesn’t seem to be a way to correct this post-installation, so I did some research and figured out a little registry hack to accomplish the same thing:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\OpenWithGitBash]
@="Open with Git Bash"
[HKEY_CLASSES_ROOT\Directory\shell\OpenWithGitBash\command]
@="\"wscript\" \"C:\\Program Files (x86)\\Git\\Git Bash.vbs\" \"%1\""
[HKEY_CLASSES_ROOT\Directory\shell\OpenWithGitGUI]
@="Open with Git GUI"
[HKEY_CLASSES_ROOT\Directory\shell\OpenWithGitGUI\command]
@="\"C:\\Program Files (x86)\\Git\\bin\\wish.exe\" \"C:\\Program Files (x86)\\Git\\libexec\\git-core\\git-gui\" \"--working-dir\" \"%1\""

Now, I can right click on a folder with a Git repository in it and open it instantly in Git Bash or Git GUI. Joy!

If you want to copy and paste the text above into a .reg file, make sure the encoding is set to UCS-2 Little Endian before you try to import it into the registry.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s