CMD Command for “Git Bash Here”

后端 未结 3 1770
感情败类
感情败类 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: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
      

提交回复
热议问题