In Windows Terminal click on the arraw down button and click Settings (alternatively, press Ctrl+Shift+,
). This will open the settings.json file. Then add "startingDirectory": ""
to the GitBash profile. This should change the default directory to where you opened the terminal.
It should be like this:
{
"guid": "{e9961a24-1111-2222-3333-835a2d22397d}",
"hidden": false,
"name": "Git Bash",
"icon" : "%PROGRAMFILES%\\git\\mingw64\\share\\git\\git-for-windows.ico",
"commandline": "%PROGRAMFILES%\\Git\\bin\\bash.exe -l -i",
"historySize" : 9001,
"padding" : "0, 0, 0, 0",
"snapOnInput" : true,
"useAcrylic" : true,
"startingDirectory": "~",
"acrylicOpacity": 0.9
}
Notes:
"startingDirectory": "~"
in this config makes Git Bash start in the user profile directory.
- You can replace
e9961a24-1111-2222-3333-835a2d22397d
with any other unique UUID.