CMD Command for “Git Bash Here”

后端 未结 3 1685
感情败类
感情败类 2020-12-19 06:16

In Windows I can run \"Git Bash Here\" in the current directory by opening right click menu.

I want to place gitbashhere.bat in default path for commands to have go

相关标签:
3条回答
  • 2020-12-19 06:19

    That is a windows shell thing. It depends on the git GUI toolkit that you've installed. For tortoiseGit, there's a setting hidden somewhere in the configuration menu. If that doesn't suit you: It's free and open software, so fix that :)

    0 讨论(0)
  • 2020-12-19 06:22

    Another way to see how a specific program was started is to launch Process Explorer, look for the process in the list of processes (for git this would be "git-bash.exe") and double-click on the process to open the properties.

    On the 'Image' tab there's a text field that yields the command line of the process:

    0 讨论(0)
  • 2020-12-19 06:40

    How do I check what command is bound to "Git Bash Here"?

    1. Open the Registry Editor using regedt32 or regedit.

    2. Menu "Edit" > "Find" > "Find what" and enter "git_shell"

    3. Examine the returned Registry entries.

    4. One will be:

      HKEY_CLASSES_ROOT\Directory\shell\git_shell\command
      

      With the 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 have installed git.

      You can see it runs something similar to the following command:

      pushd "%1" && "C:\git_install_dir\bin\sh.exe" --login -i
      
    0 讨论(0)
提交回复
热议问题