CMD Command for "Git Bash Here"

On Windows, I can run "Git Bash Here" in the current directory by opening the context menu.

I want to put gitbashhere.bat in the default path so that commands get easy access from a standard CMD window.

The sh.exe --login -i command sh.exe --login -i only opens git Bash in the sh.exe directory instead of the current directory.

How to check which team is attached to Git Bash Here ??

+6
source share
3 answers

How to check which team is attached to Git Bash Here ??

  • Open the registry editor using regedt32 or regedit .

  • Change> Find> Find What menu and enter git_shell

  • Examine the returned registry entries.

  • One will be:

     HKEY_CLASSES_ROOT\Directory\shell\git_shell\command 

    With value:

     "C:\Windows\SysWOW64\cmd.exe" /c "pushd "%1" && "C:\git_install_dir\bin\sh.exe" --login -i" 

    where git_install_dir is the directory where you installed git .

    You can see that it is doing something similar to the following command:

     pushd "%1" && "C:\git_install_dir\bin\sh.exe" --login -i 
+18
source

Another way to see how a particular program was launched is to start the "Process Explorer" , find the process in the process list (for git it will be "git - bash.exe") and double-click the process to open the properties.

On the "Image" tab there is a text field that gives the command line of the process:

enter image description here

+4
source

This is a Windows shell. It depends on the git GUI toolkit you installed. There is a setting for tortoiseGit hidden somewhere in the configuration menu. If this does not suit you: it is free and open source software, so fix it :)

-4
source

Source: https://habr.com/ru/post/983794/


All Articles