Is there a way to change the root (/) directory of git bash on windows.
By default it is set to the installation folder. Setting it to c:\ instead would save needing to type the drive letter e.g. /c/some/path on all absolute paths.
echo 'cd /c/' >> ~/.bashrc
Automatically go to /c/ directory when opening bash cli.
What you can do is mount some windows paths to a root-based msys2 paths:
mount c:/src /src
Then you can access C:/src/... as /src/...
If you installed git right, then two commands will appear in the file explorer menu when you call it with right-click. You will see nice color-full icons for both two commands: - Git GUI Here - Git bash Here took me 3 days... so you can run both from anywhere.. just go there and run from there!!
change the git bash lnk's target , remove the --cd-to-home
then add the path into start in:
here is mine enter image description here
then open git bash to test
"C:\D\"and"D:\"correspond to same/D/