- 1 year ago
Git bash in Windows: change the default directory when opening mintty (pwd)
To change the default directory that is opened when you start Git Bash in Windows using mintty, you can modify the shortcut that launches Git Bash with the following steps:
Right-click on the shortcut that launches Git Bash and select "Properties".
In the "Start in" field, enter the full path of the directory that you want to use as the default directory when Git Bash is launched.
Click "Apply" and then "OK" to save the changes.
Close any open instances of Git Bash and open it again using the modified shortcut. It should now open with the default directory set to the path you specified.
Alternatively, you can modify the ~/.bashrc
file in Git Bash to change the default directory by adding the following line at the end of the file:
bashcd /path/to/directory
Replace /path/to/directory
with the full path of the directory that you want to use as the default directory. This will change the default directory every time Git Bash is launched.