问题
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__%
回答1:
Your second option should have worked:
See this gist (also for Cmder):
- Open Conemu
- Open
Settings -> Tasksor 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
$HOMEdirectory 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.
回答2:
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"
来源:https://stackoverflow.com/questions/36675254/combine-git-bash-and-opening-in-current-folder-in-cmder