The command is:
cd /c/project/
Tip:
Use the pwd
command to see which path you are currently in, handy when you did a right-click "Git Bash here..."
Go to the directory manually and do right click → Select 'Git bash' option.
Git bash terminal automatically opens with the intended directory. For example, go to your project folder. While in the folder, right click and select the option and 'Git bash'. It will open automatically with /c/project
.
Here are the steps I followed:
In bash, check in which directory you are by using the command:
$ pwd
copy the URL of the directory you want to go like after using the first command (PWD
) I got:
$ /c/Users/yourUsername
Now I want to change this to the directory of c
drive and folder MyPictures
. To do that, I will go the directory of MyPictures
, copy the URL,
and paste it in the Git bash. However, before that:
C:\MyPicture
becomes $ cd /C/MyPicture
(backslashes are replaced with slashes)
if the folder name is having some spaces like (my program) then you need to enclose it in double quotes like:
$ cd "C:\Program Files"
Remember to change directory you just need to copy the requiredUrl
and paste that in bash with double-quotes like:
cd "required URL"
Note: URL required with slashes.
As Bob mentioned, you can change directories with cd
:
cd /c/project
If you have a Windows path with backslashes, enclose the path in double quotes:
cd "C:\project"
You can check the current folder with pwd
.
If the path contains spaces, you will need to use quotation marks. (cd "C:/Program Files"
)
On Windows, you change the default starting directory for Git Bash.
git-bash.exe
, select Properties, open Shortcuts, and change Start in: to your most commonly used folder. (screenshot)The cd
command can be memorized as "change directory".
pwd
: to check where you are (If necessary)
cd
: change directory
In your case if I understand you, you need:
cd c/project
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With