在 git bash 中输出 cmd 然后按回车就能直接切换到 git bash, 但是在 cmd 中怎么切换到 git bash 呢
1
tangc1986 24 天前
直接敲 bash 应该就可以吧
|
2
nice66 24 天前
把 git 的安装目录下的 bin 目录添加到环境变量,然后直接在 cmd 中直接输入 bash 回车
|
3
hwdq0012 24 天前
那是因为 cmd 在环境变量 PATH 目录里,所以你可以直接执行, 你还可以在 git bash 里 ipcofnig 呢。。
|
![]() |
4
elechi 24 天前
bash.exe -l -i
|
5
Need4more 24 天前
|
![]() |
6
UnluckyNinja 24 天前
安装 git 时不是有选项添加到环境变量,勾上就行了(忘记勾了那就手动加一下,一样的)
|
7
darklinden 23 天前
https://gist.github.com/darklinden/283d18c9112722d11cfd4c6fb7620f4e
```bat @REM follow https://stackoverflow.com/questions/12870928/mac-bash-git-ps1-command-not-found @REM download https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh @REM to C:\Program Files\Git\etc\git-prompt.sh @REM add `. /etc/git-prompt.sh` to your .bashrc or .bash_profile @REM download https://github.com/git/git/blob/master/contrib/completion/git-completion.bash @REM to C:\Program Files\Git\etc\git-completion.bash @REM add `. /etc/git-completion.bash` to your .bashrc or .bash_profile @echo off setlocal enableextensions set TERM= "C:\Program Files\Git\bin\bash.exe" --login -i -c "export CURRENTDIR='%CD%'; cd \"$CURRENTDIR\"; exec /bin/bash" ``` |