How to Change Directory With Git Bash
This tutorial demonstrates changing the directory in git bash using the cd
command.
Change Directory With Git Bash
Before changing the directory, you need to know your current working directory. To do this, you use the pwd
command. This command stands for print working directory.
$ pwd
The output of the code above shows that we are in /c/Users/0x30
directory.
To move from the current working directory to another directory, we use the cd
command. The cd
command stands for change directory. It takes the path of the directory where we want to move to as the argument.
In the case below, we move from the current working directory to /c/example/
using cd
.
$ cd /c/example/
To confirm that we have moved to the new directory, check the current working directory using the pwd
command.
$ pwd
From the output below, it shows that we have successfully changed directories in git bash.