When I use a git bash terminal in VSCode, I get the error
‘C:Program’ is not recognized as an internal or external command,
operable program or batch file.
That’s because the default path for git bash is C:Program Files… (see pic bellow)
I tried to install a portable Git to the folder without spaces and then in VSCode to change a git path, but it didn’t change the path for git bash. Also, I tried to add the "path" parameter in a settings.json, but it looks like the predefined terminals use the default path, not the custom ones defined in the settings.
"Git Bash": {
"path": "C:\Windows\SysWOW64\Git\bin\Bash.exe"
}
How can I set the custom path for the git bash terminal?
2
Answers
In my case what helped me was to change git.path in settings.json
Press CTRL+SHIFT+P
Type Open Settings
Choose Preferences: Open User Settings (JSON)
Change git.path parameter to that
"git.path": "C:\PROGRA~1\Git\bin\git.exe",
The explanation found here:
To change the installation path of Git Bash, try renaming
"Git Bash"
to"Git_Bash"
. VS Code seems to prefer the default path over any customized path for Git Bash due to a bug. I installed Git underD:Program Files
, so I did this: