简体   繁体   中英

Combine Git Bash and opening in current folder in CMDER

Please describe me, who have such experience, how to correctly set the options of CMDER to open new console with Git Bash in current folder(Open CMDER here, for example). This string does not work:

"C:\Program Files (x86)\Git\bin\sh.exe" --login -i -new_console:%__CD__%

I tried mix to this

""C:\Program Files (x86)\Git\bin\sh.exe" --login -i"

and this

cmd /k "%ConEmuDir%\..\init.bat" -new_console:%__CD__%

Your second option should have worked:

See this gist (also for Cmder ):

  • Open Conemu
  • Open Settings -> Tasks or go to new tab button -> Setup tasks .
  • Click + to add a new task
  • Enter the name as Git Bash or whatever you like

Task parameters:

/icon "C:\Program Files (x86)\Git\etc\git.ico" /dir "C:\_git"

Command:

"C:\Program Files (x86)\Git\bin\sh.exe" --login -i 

If you want to force your $HOME directory to be on local HD not network drive, you can do this as the command instead:

"set PATH=C:\Users\<username>;%PATH%" & "set HOME=C:\Users\Ndecarteret" & "C:\Program Files (x86)\Git\bin\sh.exe" --login -i 

This tutorial is quite complete too .

Note: your case could be related to issue 709 .

Use this script (set it as shortcut for example)

%windir%\system32\wscript.exe "C:\Program Files (x86)\Git\Git Bash.vbs" "PATH"

You simply have to use the Git Bash.vbs and pass it a path parameter to the desired folder. This is how the git bash here context menu works. pass $1 as the folder parameter.


--login

The --login command-line option passed to bash make it behave as a "login shell"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM