How to add a “open git-bash here…” context menu to the windows explorer?

From Logic Wiki
Jump to: navigation, search


Step 1 : Type "regedit" in start menu

Step 2 : Run the registry editor

Step 3 : Navigate to HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell

Step 4 : Right-click on "shell" and choose New > Key. name the Key "Bash"

Step 5 : Modify the value and set it to "open in Bash" This is the text that appears in the right click.

Step 6 : Create a new key under Bash and name it "command". Set the value of this key to your git-bash.exe path.

Add Command Prompt to right click

  1. Run the Registry Editor
  2. Go to HKEY_LOCAL_MACHINE/Software/Classes/Folder/Shell.
  3. Create a new key called Command Prompt. For the default value, enter whatever text you want to appear when you right-click a folder for example, Open Command Prompt.
  4. Create a new key beneath the Command Prompt key called Command. Set the default value to Cmd.exe /k pushd %L.
  5. Exit the Registry.

The "pushd" command stores the name of the current directory, and %L uses that name to start the command prompt at it. The new menu option will show up immediately whenever you right click any folders. Note that it won't appear when you right-click a file; it shows up only when you right-click a folder.

Alternativeley apply to this key HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell with this key value cmd.exe --cd=%v. to use it in blank background