Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the root directory (/) of git bash

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.

like image 951
79E09796 Avatar asked Aug 30 '16 15:08

79E09796


People also ask

Can I change the root directory?

You can change to the root directory of the current drive with the “cd” command or switch to a root directory on another drive. The root directory is the top-most folder on the drive. For example, “C:\” is the root directory for the C: drive and “D:\” is the root directory for the D: drive.

How do I change directory in bash?

To change directories, use the command cd followed by the name of the directory (e.g. cd downloads ). Then, you can print your current working directory again to check the new path.

Where is the root directory of Git bash?

The basic idea is that C:\Program Files\Git\mingw64\ is your / (“root”) directory according to Git Bash. If you go to that directory, you will find the typical linux root folder structure ( bin , etc , lib and so on).

What is the command to change the root directory?

To change into the root directory of Linux file system, use cd / . To go into the root user directory, run cd /root/ as root user. To navigate up one directory level up, use cd ..


1 Answers

echo 'cd /c/' >> ~/.bashrc

Automatically go to /c/ directory when opening bash cli.

like image 61
agilob Avatar answered Sep 30 '22 07:09

agilob