This write-up will explain:
- What is a Working Directory?
- Where is the Working Directory?
- How to Create a Working Directory?
- States of Files in Working Directory
What is a Working Directory?
The “Working directory”, also known as the “workspace”, is a folder that users create to store their project files. It is utilized to store or keep any file. It is essentially the user’s project folder.
Where is the Working Directory?
A working directory can be anywhere in the user’s system. Users are permitted to create it anywhere in their system.
How to Create a Working Directory?
To create a working directory/project folder, run the “mkdir <project-name>” command:
How to Know the States of Files in Working Directory?
The working directory contains untracked and tracked files. The state of files in the working directory can be seen using the “git status” command.
The below-provided screenshot shows the tracked and untracked files. The “Demo.txt” is the tracked file whereas, the “myFile.txt” is the untracked file:
That was all about knowing the working directory in Git.
Conclusion
The “working directory” or “workspace” is a folder that users create to store their project files. It is utilized to store any file. A working directory can be anywhere in the user’s system. It is created using the “mkdir <project-name>” command. Moreover, it contains untracked and tracked files. This write-up explained about the working directory.